/* Lingviny public site */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
    --paper: #F6F3EC;
    --paper-tint: #EDE8DC;
    --card: #FBF9F4;
    --ink: #15191E;
    --ink-soft: #4C525A;
    --rule: #D6D0C2;
    --accent: #C8401B;
    --accent-dark: #A63214;
    --accent-on-ink: #FF8F63;
    --apple: #86B9E6;
    --meta: #FF8F63;
    --google: #F0C350;
    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.4rem; line-height: 1.22; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 10; }
.skip-link:focus { left: 8px; color: var(--paper); }

.eyebrow { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink-soft); margin-bottom: 1.25rem; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.tag-illustrative {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    line-height: 1.5;
    padding: 1px 7px;
    border: 1px solid var(--accent);
    color: var(--accent-dark);
    white-space: nowrap;
}
.tag-illustrative--dark { border-color: var(--accent-on-ink); color: var(--accent-on-ink); }

/* Buttons */
.btn {
    display: inline-block;
    font: inherit;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.3;
    padding: 13px 22px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: #fff; border-color: #fff; color: var(--ink); }

.link-arrow { font-weight: 500; white-space: nowrap; }
.link-arrow::after { content: " →"; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 72px; gap: 8px 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.logo:hover { color: inherit; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.97rem; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent); }
.site-nav__cta { border: 1px solid var(--ink); padding: 7px 14px; border-radius: 2px; }
.site-nav__cta:hover { background: var(--ink); color: var(--paper) !important; }
.nav-toggle { display: none; font: inherit; font-size: 0.95rem; background: none; border: 1px solid var(--ink); border-radius: 2px; padding: 6px 12px; color: var(--ink); cursor: pointer; }

/* Hero */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 7vw, 104px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__text { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); margin: 1.5rem 0 2rem; max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5rem; }

/* Ledger */
.ledger { margin: 0; background: var(--card); border: 1px solid var(--ink); padding: 18px 20px 16px; box-shadow: 6px 6px 0 var(--ink); }
.ledger figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; font-size: 0.95rem; margin-bottom: 12px; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.ledger th, .ledger td { padding: 9px 8px; text-align: left; border-top: 1px solid var(--rule); vertical-align: top; }
.ledger thead th { font-weight: 500; font-size: 0.74rem; line-height: 1.25; color: var(--ink-soft); border-top: 0; vertical-align: bottom; padding-top: 0; }
.ledger tbody th, .ledger tfoot th { font-weight: 600; }
.ledger th:first-child, .ledger td:first-child { padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger .num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.ledger thead .num { font-family: var(--sans); white-space: normal; }
.ledger .is-muted { color: var(--ink-soft); }
.ledger .is-key { color: var(--accent-dark); font-weight: 500; }
.ledger tfoot th, .ledger tfoot td { border-top: 1px solid var(--ink); }
.ledger__move { color: var(--ink-soft); font-size: 0.8rem; line-height: 1.3; }
.ledger__note { font-size: 0.77rem; line-height: 1.4; color: var(--ink-soft); margin: 12px 0 0; }

/* Sections */
.section { padding: clamp(56px, 7vw, 96px) 0; }
.section--tight { padding-top: clamp(28px, 4vw, 48px); }
.section--tint { background: var(--paper-tint); }
.section--rule { border-top: 1px solid var(--rule); }
.section__head { max-width: 48em; margin-bottom: clamp(32px, 4vw, 52px); }
.section__head p { color: var(--ink-soft); font-size: 1.1rem; margin-top: 1rem; }
.section__head--link { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.section__head--link > div { max-width: 44em; }

/* Channels */
.channel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px clamp(32px, 5vw, 72px); padding: 34px 0; border-top: 1px solid var(--ink); }
.channel:last-child { border-bottom: 1px solid var(--ink); }
.channel__index { font-family: var(--mono); font-size: 0.8rem; color: var(--accent-dark); display: block; margin-bottom: 8px; }
.channel h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 10px; }
.channel__name p { color: var(--ink-soft); }
.channel__points { margin: 0; padding: 0; list-style: none; }
.channel__points li { padding: 9px 0 9px 24px; position: relative; border-top: 1px solid var(--rule); }
.channel__points li:first-child { border-top: 0; padding-top: 2px; }
.channel__points li::before { content: ""; position: absolute; left: 0; top: 19px; width: 12px; height: 2px; background: var(--accent); }
.channel__points li:first-child::before { top: 12px; }

/* Measurement band */
.band { background: var(--ink); color: var(--paper); padding: clamp(56px, 7vw, 100px) 0; }
.band__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.band h2 + p { margin-top: 1.25rem; color: #C9CBC8; font-size: 1.1rem; }
.claim-chart { margin: 0; }
.claim-chart figcaption { font-size: 0.95rem; color: #C9CBC8; margin-bottom: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.claim-chart__label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 8px; font-size: 0.97rem; }
.claim-chart__label strong { font-family: var(--mono); font-weight: 500; font-size: 1.15rem; }
.claim-chart__bar { display: flex; gap: 2px; margin-bottom: 26px; }
.seg { display: block; min-width: 0; height: 48px; line-height: 48px; font-family: var(--mono); font-size: 0.8rem; color: var(--ink); text-align: center; overflow: hidden; }
.seg--apple { background: var(--apple); }
.seg--meta { background: var(--meta); }
.seg--google { background: var(--google); }
.claim-chart__legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; font-size: 0.88rem; color: #C9CBC8; }
.claim-chart__legend i { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; }

/* Measurement stack */
.stack { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5vw, 72px); }
.stack > div { padding: 18px 0; border-top: 1px solid var(--rule); }
.stack dt { font-weight: 600; margin-bottom: 4px; }
.stack dd { margin: 0; color: var(--ink-soft); }

/* Process */
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.process li { border-top: 2px solid var(--ink); padding-top: 14px; counter-increment: step; }
.process li::before { content: "0" counter(step); font-family: var(--mono); font-size: 0.8rem; color: var(--accent-dark); }
.process h3 { margin: 6px 0 10px; }
.process p { color: var(--ink-soft); font-size: 0.98rem; }

/* Case studies */
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.case-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-card { background: var(--card); border: 1px solid var(--rule); padding: 24px; display: flex; flex-direction: column; }
.case-card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); margin-bottom: 14px; }
.case-card h3 { margin-bottom: 12px; }
.case-card h3 a { text-decoration: none; }
.case-card h3 a:hover { text-decoration: underline; }
.case-card > p { color: var(--ink-soft); font-size: 0.97rem; }
.case-card p.case-card__metric { margin: auto 0 0; padding-top: 16px; color: var(--ink); }
.case-card__metric strong { display: block; font-family: var(--mono); font-weight: 500; font-size: 1.6rem; line-height: 1.2; }
.case-card__metric span { font-size: 0.82rem; color: var(--ink-soft); }

.disclaimer { border-left: 3px solid var(--accent); background: var(--card); padding: 12px 16px; margin-bottom: 32px; font-size: 0.95rem; }
.disclaimer--reading { max-width: 720px; margin: 0 auto 28px; }

/* Article lists */
.article-list { border-bottom: 1px solid var(--rule); }
.article-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 24px; padding: 24px 0; border-top: 1px solid var(--rule); }
.article-row__meta { font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; color: var(--ink-soft); margin: 4px 0 0; display: flex; flex-direction: column; }
.article-row h3 { margin-bottom: 8px; }
.article-row h3 a { text-decoration: none; }
.article-row h3 a:hover { text-decoration: underline; }
.article-row div p { color: var(--ink-soft); max-width: 46em; }

.page-head { padding: clamp(48px, 6vw, 80px) 0 clamp(16px, 2vw, 24px); }
.page-head > .wrap > p:not(.eyebrow):not(.hero__actions) { font-size: 1.2rem; color: var(--ink-soft); margin-top: 1rem; max-width: 40em; }
.page-head--error { padding-bottom: clamp(64px, 10vw, 140px); }

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.filters nav { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a { font-size: 0.88rem; padding: 4px 11px; border: 1px solid var(--rule); border-radius: 2px; text-decoration: none; }
.filters a:hover { border-color: var(--ink); color: var(--ink); }
.filters a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; }
.pagination__status { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); }
.pagination__edge { font-weight: 500; }
.pagination__edge.is-disabled { color: var(--rule); font-weight: 400; }

/* Reading pages */
.reading { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 7vw, 88px); }
.reading__head { max-width: 768px; margin-bottom: clamp(28px, 4vw, 40px); }
.reading h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.reading__lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); margin: 1.25rem 0; }
.reading__meta { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 18px; border-top: 1px solid var(--rule); padding-top: 12px; }

.prose { max-width: 720px; margin: 0 auto; font-size: 1.08rem; line-height: 1.68; }
.prose h2 { font-size: 1.75rem; margin: 2.2em 0 0.6em; line-height: 1.2; }
.prose h3 { font-size: 1.28rem; margin: 1.8em 0 0.5em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose a { color: var(--accent-dark); }
.prose blockquote { margin: 1.5em 0; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--ink-soft); }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.93rem; line-height: 1.45; margin: 1.5em 0; }
.prose th, .prose td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; min-width: 90px; }
.prose thead th { border-bottom: 1px solid var(--ink); font-weight: 600; }

.metrics { max-width: 720px; margin: 0 auto 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px 24px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 18px 0; }
.metrics dd { margin: 0; font-family: var(--mono); font-size: 1.35rem; font-weight: 500; line-height: 1.25; overflow-wrap: normal; }
.metrics dt { font-size: 0.85rem; line-height: 1.35; color: var(--ink-soft); margin-top: 4px; }
.metrics__note { max-width: 720px; margin: 0 auto 32px; font-size: 0.8rem; color: var(--ink-soft); }

/* FAQ */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px clamp(32px, 5vw, 72px); }
.faq details { border-top: 1px solid var(--ink); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--ink); }
.faq summary { font-weight: 500; font-size: 1.08rem; cursor: pointer; padding-right: 24px; list-style-position: outside; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); }

/* Closing CTA */
.cta { padding: clamp(56px, 7vw, 88px) 0; }
.cta__row { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta p { color: var(--ink-soft); font-size: 1.1rem; margin-top: 12px; max-width: 38em; }

/* Forms */
.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.field label span { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    padding: 11px 12px;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 2px;
}
.field textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 14px; }
.notice { list-style: none; padding: 14px 16px; margin: 0 0 18px; font-size: 0.98rem; border-left: 3px solid; }
.notice--ok { background: #E3EFE5; color: #123F22; border-color: #1F7A3D; }
.notice--error { background: #F9E6E0; color: #71210B; border-color: var(--accent); }

.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); }
.contact__text { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); margin-top: 1.25rem; }
.contact { padding-top: clamp(48px, 6vw, 80px); }

/* Newsletter */
.newsletter { background: var(--ink); color: var(--paper); padding: clamp(44px, 6vw, 68px) 0; scroll-margin-top: 0; }
.newsletter__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px clamp(32px, 5vw, 72px); align-items: center; }
.newsletter h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.newsletter h2 + p { color: #C9CBC8; margin-top: 10px; }
.newsletter__form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: end; }
.newsletter .field { margin: 0; }
.newsletter .field input { background: transparent; color: var(--paper); border-color: #8A8D8E; }
.newsletter .field input:focus { border-color: var(--paper); outline-color: var(--paper); }
.newsletter :focus-visible { outline-color: var(--paper); }
.newsletter__consent { font-size: 0.82rem; color: #C9CBC8; margin: 10px 0 0; }
.newsletter a:hover { color: var(--accent-on-ink); }

/* Footer */
.site-footer { padding: 44px 0 26px; }
.site-footer__grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px 64px; }
.site-footer__grid > div { max-width: 30em; color: var(--ink-soft); font-size: 0.95rem; }
.site-footer__name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.95rem; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer__small { margin-top: 28px; font-size: 0.8rem; color: var(--ink-soft); }

@media (max-width: 1040px) {
    .hero__grid, .band__grid { grid-template-columns: minmax(0, 1fr); }
    .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .newsletter__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    :root { --gutter: 16px; }
    body { font-size: 16px; }
    .js .nav-toggle { display: block; }
    .js .site-nav { display: none; }
    .site-nav { flex-basis: 100%; flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: 12px; }
    .js .site-nav.is-open { display: flex; }
    .site-nav a { padding: 9px 0; width: 100%; }
    .site-nav__cta { border: 0; padding: 9px 0; color: var(--accent-dark); font-weight: 500; }
    .site-nav__cta:hover { background: none; color: var(--accent) !important; }
    .site-header__row { min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
    .hero__text { font-size: 1.08rem; }
    .ledger { padding: 14px 14px 12px; box-shadow: 4px 4px 0 var(--ink); }
    .ledger table { font-size: 0.82rem; }
    .ledger th, .ledger td { padding: 8px 5px; }
    .ledger__move { display: none; }
    .channel { grid-template-columns: minmax(0, 1fr); padding: 26px 0; }
    .stack { grid-template-columns: minmax(0, 1fr); }
    .process { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .case-grid, .case-grid--two { grid-template-columns: minmax(0, 1fr); }
    .section__head--link { flex-direction: column; align-items: flex-start; gap: 12px; }
    .article-row { grid-template-columns: minmax(0, 1fr); padding: 20px 0; }
    .article-row__meta { flex-direction: row; gap: 14px; margin: 0; }
    .faq { grid-template-columns: minmax(0, 1fr); }
    .contact__grid { grid-template-columns: minmax(0, 1fr); }
    .newsletter__form { grid-template-columns: minmax(0, 1fr); }
    .newsletter__form .btn { justify-self: start; }
    .seg { font-size: 0.72rem; height: 42px; line-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn { transition: none; }
}
