/* Typsastra product website */
@font-face {
  font-family: "Noto Serif Khmer";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/noto-serif-khmer.woff2") format("woff2");
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

:root {
  color-scheme: light;
  --bg: #f5f4ee;
  --surface: #fbfaf6;
  --surface-2: #eceae2;
  --text: #17211b;
  --muted: #606a63;
  --faint: #818982;
  --brand: #174433;
  --brand-2: #235c46;
  --brand-dark: #0d291f;
  --lime: #c7ef78;
  --blue: #6684e9;
  --line: rgba(23, 33, 27, 0.14);
  --line-strong: rgba(23, 33, 27, 0.24);
  --shadow: 0 26px 70px rgba(18, 39, 29, 0.13);
  --radius: 22px;
  --container: 1180px;
  --header: 70px;
  --sans: "Noto Serif Khmer", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Noto Serif Khmer", "Times New Roman", serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101713;
  --surface: #151e19;
  --surface-2: #0c120e;
  --text: #eff3ef;
  --muted: #adb8b0;
  --faint: #7f8b82;
  --brand: #b7dda0;
  --brand-2: #98c47f;
  --brand-dark: #081c15;
  --line: rgba(238, 245, 240, 0.13);
  --line-strong: rgba(238, 245, 240, 0.22);
  --shadow: 0 28px 72px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }
svg { display: block; }
button { font: inherit; }
::selection { background: var(--lime); color: #132018; }
.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 9px 15px; border-radius: 8px; background: var(--text); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 100; top: 0; height: var(--header); border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px); transition: border-color 160ms ease; }
.site-header.scrolled { border-color: var(--line); }
.nav-shell { width: min(calc(100% - 40px), 1280px); height: 100%; margin-inline: auto; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 780; letter-spacing: -0.035em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.desktop-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.desktop-nav a { color: var(--muted); font-size: 13px; font-weight: 650; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { color: var(--text); }
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { display: flex; align-items: center; gap: 5px; }
.nav-dropdown-trigger svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 150ms ease; }
.nav-dropdown-menu { position: absolute; top: calc(100% + 14px); left: 50%; width: 286px; padding: 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 7px); transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease; }
.nav-dropdown-menu::before { content: ""; position: absolute; inset: -15px 0 auto; height: 15px; }
.nav-dropdown-menu a { padding: 10px 12px; display: block; border-radius: 10px; color: var(--text); }
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible,
.nav-dropdown-menu a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--brand-2);
}
.nav-dropdown-menu span, .nav-dropdown-menu small { display: block; }
.nav-dropdown-menu span { font-size: 13px; font-weight: 740; }
.nav-dropdown-menu small { margin-top: 1px; color: var(--faint); font-size: 10px; font-weight: 550; }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.nav-dropdown:hover .nav-dropdown-trigger svg, .nav-dropdown:focus-within .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .sun-icon, html:not([data-theme="dark"]) .moon-icon { display: none; }
.menu-toggle { display: none; }
.close-icon { display: none !important; }
.menu-toggle[aria-expanded="true"] .menu-icon { display: none; }
.menu-toggle[aria-expanded="true"] .close-icon { display: block !important; }
.mobile-menu { position: absolute; z-index: 1; top: 100%; right: 0; left: 0; height: calc(100vh - var(--header)); height: calc(100dvh - var(--header)); padding: 22px 20px 40px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-top: 1px solid var(--line); }
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.button) { display: block; padding: 15px 2px; border-bottom: 1px solid var(--line); font-size: 21px; font-weight: 680; }
.mobile-menu a[href="/ocr/"],
.mobile-menu a[href="/segmenter/"],
.mobile-menu a[href="/enhanced-unicode/"],
.mobile-menu a[href="/docx/"] { padding-left: 20px; font-size: 18px; }
.mobile-menu .button { width: 100%; margin-top: 26px; }

.button { min-height: 46px; padding: 11px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 750; line-height: 1.1; transition: transform 150ms ease, border-color 150ms ease, background 150ms ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 65%, transparent); outline-offset: 3px; }
.button-primary { background: var(--brand-dark); color: #f7faf7; box-shadow: 0 12px 28px rgba(13, 41, 31, 0.18); }
html[data-theme="dark"] .button-primary { background: var(--lime); color: #132018; box-shadow: none; }
.button-secondary { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 72%, transparent); }
.button-secondary:hover { border-color: var(--muted); }
.button-small { min-height: 40px; padding: 9px 17px; background: var(--brand-dark); color: white; }
html[data-theme="dark"] .button-small { background: var(--text); color: var(--surface-2); }
.button svg, .text-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand-2); font-size: 13px; font-weight: 760; }
.text-link:hover svg { transform: translateX(3px); }

.eyebrow { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; color: var(--brand-2); font-size: 11px; line-height: 1.2; font-weight: 820; letter-spacing: 0.16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.eyebrow-center { justify-content: center; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
h1 { font-size: clamp(3.4rem, 7.6vw, 7rem); }
h2 { font-size: clamp(2.4rem, 4.8vw, 4.5rem); }
h3 { line-height: 1.25; letter-spacing: -0.025em; }
.lede { color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.6; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); }

.home-hero { position: relative; min-height: 760px; padding: 110px 0 70px; overflow: hidden; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; }
.home-hero::after, .page-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 45% 25%, color-mix(in srgb, var(--bg) 20%, transparent), var(--bg) 72%); pointer-events: none; }
.home-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); align-items: center; gap: 74px; }
.home-hero-grid > *, .intro-grid > *, .mission-grid > *, .page-hero-grid > *, .explainer > *, .footer-main > * { min-width: 0; }
.home-hero h1 { margin-bottom: 27px; font-size: clamp(3.8rem, 6.7vw, 6.7rem); }
.home-hero h1 em { color: var(--brand-2); font-weight: inherit; }
.home-hero .lede { max-width: 610px; margin-bottom: 31px; }
.action-row { display: flex; flex-wrap: wrap; gap: 11px; }
.home-hero .status { margin-top: 18px; }
.home-hero-simple { min-height: 680px; display: flex; align-items: center; }
.home-hero-simple .container { position: relative; z-index: 1; }
.home-hero-simple h1 { max-width: 980px; }
.home-hero-simple .lede { max-width: 720px; }
.hero-product-window { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 17px; background: #111a15; box-shadow: var(--shadow); transform: perspective(1400px) rotateY(-2deg); }
.window-top { height: 38px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.09); color: #94a098; font-size: 10px; }
.window-dots { display: flex; gap: 6px; }
.window-dots i { width: 7px; height: 7px; border-radius: 50%; background: #68736c; }
.hero-product-window img { width: 100%; }
.home-intro { padding: 105px 0; background: var(--surface); border-block: 1px solid var(--line); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); align-items: end; gap: 90px; }
.intro-grid h2 { margin: 0; }
.intro-grid .lede { margin: 0; }

.products-section { padding: 110px 0; }
.section-head { max-width: 740px; margin-bottom: 54px; }
.section-head h2 { margin-bottom: 23px; }
.section-head > p:last-child { color: var(--muted); font-size: 17px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.product-tile { min-height: 325px; padding: 32px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.product-tile:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 55px rgba(18,39,29,0.08); }
.product-tile.featured { grid-column: span 2; min-height: 380px; display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 60px; color: white; background: var(--brand-dark); }
.product-tile.featured > * { min-width: 0; }
.product-tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.product-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--brand-2); font: 500 20px/1 var(--serif); }
.product-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.featured .product-icon { border-color: rgba(255,255,255,0.2); color: var(--lime); }
.product-tag { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.featured .product-tag { border-color: rgba(255,255,255,0.17); color: #b5c2ba; }
.product-tile-copy { margin-top: auto; }
.product-tile h3 { margin: 0 0 11px; font: 500 31px/1.1 var(--serif); }
.product-tile p { max-width: 530px; margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.featured h3 { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.featured p { color: #b5c3ba; font-size: 16px; }
.featured-visual { width: 100%; aspect-ratio: 16 / 10; align-self: center; overflow: hidden; border: 1px solid rgba(255,255,255,0.14); border-radius: 13px; box-shadow: 0 24px 60px rgba(0,0,0,0.26); }
.featured-visual img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }

.mission { padding: 115px 0; color: white; background: #153126; }
.mission-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 100px; align-items: center; }
.mission h2 { margin: 0; }
.mission h2 em { color: var(--lime); font-weight: inherit; }
.mission-list { border-top: 1px solid rgba(255,255,255,0.17); }
.mission-list div { padding: 18px 0; display: grid; grid-template-columns: 36px 1fr; gap: 14px; border-bottom: 1px solid rgba(255,255,255,0.17); }
.mission-list span { color: var(--lime); font-size: 10px; font-weight: 800; }
.mission-list p { margin: 0; color: #c3cfc7; font-size: 14px; }

.page-hero { position: relative; padding: 105px 0 100px; overflow: hidden; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; }
.page-hero-inner { position: relative; z-index: 1; }
.breadcrumb { margin-bottom: 60px; display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 11px; font-weight: 650; }
.breadcrumb a:hover { color: var(--text); }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr); gap: 90px; align-items: end; }
.page-hero h1 { max-width: 850px; margin: 0 0 26px; font-size: clamp(3.5rem, 6.7vw, 6.5rem); }
.page-hero h1 em { color: var(--brand-2); font-weight: inherit; }
.page-hero-copy .lede { max-width: 720px; margin-bottom: 31px; }
.hero-facts { padding: 25px 0 0 34px; border-left: 1px solid var(--line-strong); }
.hero-facts div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.hero-facts span, .hero-facts strong { display: block; }
.hero-facts span { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-facts strong { margin-top: 3px; font-size: 13px; }

.product-media { padding: 72px 0; background: var(--surface-2); }
.product-media .hero-product-window { max-width: 1050px; margin: auto; transform: none; }
.feature-section { padding: 105px 0; }
.feature-section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.feature-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-card { min-height: 270px; padding: 31px; background: var(--bg); }
.alt .feature-card { background: var(--surface); }
.feature-card + .feature-card { border-left: 1px solid var(--line); }
.feature-card .product-icon { margin-bottom: 48px; }
.feature-card h3 { margin-bottom: 10px; font: 500 23px/1.2 var(--serif); }
.feature-card p { margin: 0; color: var(--muted); font-size: 13px; }
.explainer { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: 90px; }
.explainer.reverse { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.explainer h2 { margin-bottom: 23px; }
.explainer-copy > p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.diagram { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.diagram-flow { display: grid; gap: 10px; }
.diagram-step { padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.diagram-step strong { font-size: 13px; }
.diagram-step span { color: var(--faint); font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.diagram-arrow { color: var(--brand-2); text-align: center; font-size: 17px; }
.code-panel { overflow: auto; padding: 26px; border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); background: #0b1711; color: #d9e5dd; box-shadow: var(--shadow); }
.code-panel pre { margin: 0; font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.code-panel .comment { color: #76877c; }
.code-panel .key { color: var(--lime); }
.checks { margin: 28px 0 0; padding: 0; list-style: none; }
.checks li { padding: 11px 0; display: flex; gap: 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.checks li::before { content: "✓"; flex: 0 0 auto; color: var(--brand-2); font-weight: 800; }
.checks code { overflow-wrap: anywhere; word-break: break-word; }
.notice { margin-top: 28px; padding: 18px 21px; border-left: 3px solid var(--brand-2); background: var(--surface); color: var(--muted); font-size: 13px; }

.product-nav { padding: 74px 0; border-top: 1px solid var(--line); }
.home-product-nav { padding-block: 100px; border-top: 0; }
.product-nav-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 29px; }
.product-nav-head h2 { margin: 0; font-size: clamp(2.2rem, 4vw, 3.5rem); }
.product-nav-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.mini-product { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.mini-product:hover { border-color: var(--line-strong); }
.mini-product span { color: var(--faint); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.mini-product strong { display: block; margin-top: 23px; font: 500 19px/1.2 var(--serif); }

.page-cta { position: relative; padding: 100px 0; overflow: hidden; text-align: center; background: var(--surface-2); border-top: 1px solid var(--line); }
.page-cta h2 { max-width: 790px; margin: 0 auto 22px; }
.page-cta p { max-width: 610px; margin: 0 auto 30px; color: var(--muted); font-size: 17px; }
.page-cta .action-row { justify-content: center; }

.site-footer { padding: 65px 0 25px; background: #0b1711; color: #dfe7e2; }
.footer-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 90px; padding-bottom: 55px; }
.footer-brand p { max-width: 340px; margin: 18px 0 0; color: #829188; font-size: 12px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.footer-links strong, .footer-links a { display: block; }
.footer-links strong { margin-bottom: 12px; font-size: 11px; }
.footer-links a { padding: 4px 0; color: #829188; font-size: 11px; }
.footer-links a:hover { color: white; }
.footer-bottom { padding-top: 20px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255,255,255,0.1); color: #65736b; font-size: 10px; }
.footer-bottom p { margin: 0; }

@media (max-width: 980px) {
  .desktop-nav, .nav-download { display: none; }
  .nav-actions { margin-left: auto; }
  .menu-toggle { display: grid; }
  .home-hero-grid, .page-hero-grid, .intro-grid, .mission-grid, .explainer, .explainer.reverse { grid-template-columns: 1fr; }
  .home-hero-grid { gap: 60px; }
  .home-hero { padding-top: 80px; }
  .hero-product-window { transform: none; }
  .page-hero-grid { gap: 50px; }
  .hero-facts { padding: 0; border-left: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .product-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .explainer { gap: 50px; }
}
@media (max-width: 720px) {
  :root { --header: 64px; }
  .container, .nav-shell { width: min(calc(100% - 28px), var(--container)); }
  .home-hero { min-height: auto; padding: 70px 0 60px; background-size: 44px 44px; }
  .home-hero h1, .page-hero h1 { font-size: clamp(3.1rem, 14vw, 4.7rem); }
  .lede { font-size: 16px; }
  .action-row { flex-direction: column; }
  .action-row .button { width: 100%; }
  .home-intro, .products-section, .feature-section { padding: 75px 0; }
  .product-grid { grid-template-columns: 1fr; }
  .product-tile.featured { grid-column: auto; min-height: 540px; grid-template-columns: 1fr; gap: 35px; }
  .product-tile { min-height: 290px; padding: 26px; }
  .mission { padding: 80px 0; }
  .page-hero { padding: 65px 0 75px; background-size: 44px 44px; }
  .breadcrumb { margin-bottom: 42px; }
  .hero-facts { grid-template-columns: 1fr; gap: 0; }
  .feature-cards { grid-template-columns: 1fr; }
  .feature-card { min-height: 220px; padding: 27px; }
  .feature-card + .feature-card { border-left: 0; border-top: 1px solid var(--line); }
  .feature-card .product-icon { margin-bottom: 32px; }
  .product-media { padding: 45px 0; }
  .diagram { padding: 18px; }
  .product-nav-grid { grid-template-columns: 1fr; }
  .product-nav-head { display: block; }
  .product-nav-head .text-link { margin-top: 13px; }
  .page-cta { padding: 75px 0; }
  .footer-main { grid-template-columns: 1fr; gap: 42px; }
  .footer-links { gap: 18px; }
  .footer-bottom { align-items: flex-start; }
}
@media (max-width: 420px) { .footer-links { grid-template-columns: 1fr 1fr; row-gap: 28px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
