/*
 * Syllune site: the shared system every section and page is built from.
 * Fonts, the two fields, five type sizes, the 12-column grid on the hero's
 * edge, spacing, shape, motion and focus, and the few parts the page repeats
 * (text links, keycaps, the said / typed fragment). Sections use these
 * tokens only, never raw values. Source: docs/website-spec.md, sections 4–5.
 */

/* ================================================================== fonts */
/* Every family is served from this site; licences sit beside the files.
   Schibsted Grotesk for everything people read, Fragment Mono only for what
   really is code or a key (spec 4.2, 4.8). */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk/schibsted-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk/schibsted-grotesk-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/fragment-mono/fragment-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/fragment-mono/fragment-mono-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* While the real faces load, a local face stretched to the same width, so
   the text does not jump when they arrive (spec 10.3). Measured against
   Schibsted Grotesk 400 and Fragment Mono 400. */
@font-face {
  font-family: "Schibsted Grotesk Fallback";
  src: local("Arial");
  size-adjust: 101.5%;
  ascent-override: 96%;
  descent-override: 26%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Fragment Mono Fallback";
  src: local("Consolas"), local("Courier New");
  size-adjust: 112%;
  ascent-override: 90%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* ================================================================= tokens */

:root {
  /* ---- fields (spec 4.1). The black field; .field-white swaps in the day. */
  --ground: #000000;
  --ink: #ffffff;              /* all running text */
  --ink-2: #8f8f8f;            /* secondary notes only, never paragraphs (6.4 : 1) */
  --surface: #0e0e0e;          /* interface fragments: the terminal, a chat, an email */
  --surface-raised: #1a1a1a;   /* fields inside a fragment: a composer, a prompt box, a page (--ink-2 on it 5.4 : 1) */
  --rule: rgba(255, 255, 255, 0.16);   /* real tables only */

  /* The white field's ground and ink, also used by the bar while it is
     over that field. The ink is the logo colour, Syllune's one near-black. */
  --day-ground: #ffffff;
  --day-ink: #05070b;

  /* ---- faces */
  --font-sans: "Schibsted Grotesk", "Schibsted Grotesk Fallback", "Segoe UI", system-ui, sans-serif;
  --font-code: "Fragment Mono", "Fragment Mono Fallback", "Cascadia Mono", Consolas, ui-monospace, monospace;

  /* ---- the six sizes (spec 4.3). Each has its weight, leading and
     tracking; nothing on the page is set at any other size. Display is the
     hero's alone; every section below it opens with a heading. */
  --t-display: clamp(2.1rem, 0.8rem + 3.6vw, 5.25rem);
  --t-display-weight: 800;
  --t-display-leading: 0.98;
  --t-display-tracking: -0.042em;

  --t-heading: clamp(1.75rem, 0.75rem + 2.4vw, 3.5rem);
  --t-heading-weight: 800;
  --t-heading-leading: 1;
  --t-heading-tracking: -0.035em;

  --t-statement: clamp(1.5rem, 1.05rem + 1.3vw, 2.25rem);
  --t-statement-weight: 500;
  --t-statement-leading: 1.18;
  --t-statement-tracking: -0.02em;

  --t-lead: clamp(1.1875rem, 1.05rem + 0.4vw, 1.375rem);
  --t-lead-weight: 400;
  --t-lead-leading: 1.4;
  --t-lead-tracking: -0.01em;

  --t-body: 1.0625rem;
  --t-body-weight: 400;
  --t-body-leading: 1.55;
  --t-body-tracking: 0;

  --t-small: 0.875rem;
  --t-small-weight: 400;
  --t-small-leading: 1.45;
  --t-small-tracking: 0.005em;

  /* Measures: headings stay within two lines, body lines 45–70 characters. */
  --measure-heading: 16ch;
  --measure-body: 64ch;

  /* ---- grid (spec 4.4). The outer margin is the hero's --edge, so every
     section shares the hero title's left edge at every width. */
  --edge: clamp(1.25rem, 0.6rem + 2.2vw, 2.75rem);
  --gutter: clamp(1rem, 0.6rem + 1.2vw, 1.75rem);
  --columns: 12;

  /* ---- space (spec 4.5): an 8 px base and only these steps inside a section. */
  --s1: 0.5rem;     /* 8 */
  --s2: 1rem;       /* 16 */
  --s3: 1.5rem;     /* 24 */
  --s4: 2rem;       /* 32 */
  --s5: 3rem;       /* 48 */
  --s6: 5rem;       /* 80 */
  --s7: 8rem;       /* 128 */
  --section-gap: clamp(7.5rem, 4rem + 9vw, 15rem);   /* 120–240, always more than any gap inside */
  --heading-gap: var(--s5);                          /* heading to its first content */

  /* ---- shape (spec 4.6). Square corners; keycaps are the one real object
     drawn with a radius (the pill draws its own). */
  --radius-key: 0.3em;

  /* ---- motion (spec 4.9). One easing, three durations. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-press: 150ms;      /* hover and press */
  --dur-state: 250ms;      /* state changes */
  --dur-settle: 750ms;     /* settling, 600–900 */

  /* ---- focus (spec 4.10) */
  --focus-ring: 2px solid var(--ink);
  --focus-offset: 3px;
  --target-min: 44px;
}

/* Phones: four columns on the same margin, a tighter heading gap. */
@media (max-width: 47.99rem) {
  :root {
    --columns: 4;
    --heading-gap: var(--s4);
  }
}

/* The white field (Privacy). Only the inks change; there is no surface here. */
.field-white {
  --ground: var(--day-ground);
  --ink: var(--day-ink);
  --ink-2: #5e5e5e;            /* 6.5 : 1 */
  --rule: rgba(0, 0, 0, 0.16);
  background: var(--ground);
  color: var(--ink);
}

/* ================================================================== reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ground);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: var(--t-body-weight);
  line-height: var(--t-body-leading);
  font-kerning: normal;
  hanging-punctuation: first;
}

h1, h2, h3, p, ol, ul, figure, blockquote, pre {
  margin: 0;
}

ol, ul {
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
}

/* Pictures and frames sit on their own line. Inline SVG stays inline: the
   hero draws the Windows mark beside its version number with it. */
img, iframe {
  display: block;
  max-width: 100%;
}

/* Selection is the field inverted. */
::selection {
  background: var(--ink);
  color: var(--ground);
}

/* Read by screen readers, never seen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =================================================================== type */
/* One class per size. Mono takes the same sizes (.code). */

.t-display {
  font-size: var(--t-display);
  font-weight: var(--t-display-weight);
  line-height: var(--t-display-leading);
  letter-spacing: var(--t-display-tracking);
}

.t-heading {
  font-size: var(--t-heading);
  font-weight: var(--t-heading-weight);
  line-height: var(--t-heading-leading);
  letter-spacing: var(--t-heading-tracking);
}

.t-statement {
  font-size: var(--t-statement);
  font-weight: var(--t-statement-weight);
  line-height: var(--t-statement-leading);
  letter-spacing: var(--t-statement-tracking);
}

.t-lead {
  font-size: var(--t-lead);
  font-weight: var(--t-lead-weight);
  line-height: var(--t-lead-leading);
  letter-spacing: var(--t-lead-tracking);
}

.t-body {
  font-size: var(--t-body);
  font-weight: var(--t-body-weight);
  line-height: var(--t-body-leading);
  letter-spacing: var(--t-body-tracking);
}

.t-small {
  font-size: var(--t-small);
  font-weight: var(--t-small-weight);
  line-height: var(--t-small-leading);
  letter-spacing: var(--t-small-tracking);
}

/* Section headings: display size, two lines at most, balanced. */
.heading {
  max-width: var(--measure-heading);
  text-wrap: balance;
}

/* Running text: a readable measure, no lonely last words. */
.prose {
  max-width: var(--measure-body);
  text-wrap: pretty;
}

/* Secondary notes: captions, Free / Pro marks. Never a paragraph. */
.note {
  color: var(--ink-2);
}

/* Code, hostnames, the terminal. Never a label (spec 4.8). */
.code {
  font-family: var(--font-code);
  font-variant-ligatures: none;
  letter-spacing: 0;
}

/* Prices, versions, sizes, dates. */
.numbers {
  font-variant-numeric: tabular-nums;
}

/* =================================================================== grid */
/* Every section below the hero is a .section on the 12-column .grid. Text
   starts on only three edges on the whole page: columns 1, 5 and 7. */

.section {
  position: relative;
  padding-block: 0 var(--section-gap);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: max(var(--edge), env(safe-area-inset-left)) max(var(--edge), env(safe-area-inset-right));
}

/* Full width by default; the named spans the spec uses. */
.grid > * {
  grid-column: 1 / -1;
}

@media (min-width: 48rem) {
  .span-1-7 { grid-column: 1 / span 7; }
  .span-1-8 { grid-column: 1 / span 8; }
  .span-1-12 { grid-column: 1 / -1; }
  .span-5-12 { grid-column: 5 / -1; }
  .span-7-12 { grid-column: 7 / -1; }
}

/* ================================================================== parts */

/* ---- text links (spec 5.2). Underlined in ink; the underline thickens on
   hover and focus, nothing else changes. */
.section a,
.site-foot a,
.plain a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-thickness var(--dur-press) var(--ease-out);
}

.section a:focus-visible,
.site-foot a:focus-visible,
.plain a:focus-visible {
  text-decoration-thickness: 2px;
}

@media (hover: hover) {
  .section a:hover,
  .site-foot a:hover,
  .plain a:hover {
    text-decoration-thickness: 2px;
  }
}

/* ---- skip link: the first stop for the keyboard, out of sight until it
   has focus. */
.skip-link {
  position: absolute;
  top: var(--s2);
  left: max(var(--edge), env(safe-area-inset-left));
  z-index: 10;
  padding: var(--s1) var(--s2);
  background: var(--ink);
  color: var(--ground);
  font-size: var(--t-small);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(calc(-100% - var(--s4)));
}

.skip-link:focus {
  transform: none;
}

/* ---- focus (spec 4.10): one ring on everything interactive, never removed.
   The hero's bar and Download keep their own, set in hero.css. */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ---- text buttons: the same underlined word as a link, at least 44 px tall. */
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-thickness var(--dur-press) var(--ease-out);
}

@media (hover: hover) {
  .text-button:hover {
    text-decoration-thickness: 2px;
  }
}

.text-button:focus-visible {
  text-decoration-thickness: 2px;
}

/* ---- keycaps (spec 5.4): only for real keys. */
kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent);
  border-radius: var(--radius-key);
  font-family: var(--font-code);
  font-size: var(--t-small);
  line-height: var(--t-small-leading);
  font-variant-ligatures: none;
  white-space: nowrap;
}

/* ---- the said / typed fragment (spec 5.5): the page's one repeated
   object. Said like a film subtitle, the five bars, typed on a surface,
   a caption saying where. */
.fragment-said {
  color: var(--ink-2);
  font-size: var(--t-lead);
  line-height: var(--t-lead-leading);
  letter-spacing: var(--t-lead-tracking);
  text-wrap: balance;
}

.fragment-typed {
  padding: var(--s3) var(--s4);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-lead);
  line-height: var(--t-lead-leading);
  letter-spacing: var(--t-lead-tracking);
}

.fragment-typed.code {
  letter-spacing: 0;
}

.fragment-caption {
  color: var(--ink-2);
  font-size: var(--t-small);
  line-height: var(--t-small-leading);
}

/* The five bars of the mark, at the size of the text around them: the one
   device that stands between speech and text, never an arrow. The heights
   are the app icon's (overlay/assets/syllune.svg), as in the bar. */
.bars {
  display: inline-flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 1.165em;
  height: 1em;
  color: var(--ink-2);
  vertical-align: -0.12em;
}

.bars > span {
  width: 0.148em;
  border-radius: 1em;
  background: currentColor;
}

.bars > span:nth-child(1) { height: 0.435em; margin-top: 0.413em; }
.bars > span:nth-child(2) { height: 0.783em; margin-top: 0.130em; }
.bars > span:nth-child(3) { height: 1em; }
.bars > span:nth-child(4) { height: 0.783em; margin-top: 0.087em; }
.bars > span:nth-child(5) { height: 0.435em; margin-top: 0.152em; }

/* ---- tables (spec 5.6): the hosts and the requirements, and the plans.
   A rule between rows and under the header, nothing else: no outer border,
   no stripes, no header fill. */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-body);
  line-height: var(--t-body-leading);
}

.table th,
.table td {
  padding: var(--s2) var(--s3) var(--s2) 0;
  font-weight: inherit;
  text-align: left;
  vertical-align: top;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.table thead th {
  padding-block: 0 var(--s1);
  font-size: var(--t-small);
  font-weight: 500;
  line-height: var(--t-small-leading);
}

.table thead + tbody tr:first-child,
.table tbody tr + tr {
  border-top: 1px solid var(--rule);
}

/* ---- the large Download (spec 5.3): the hero's underlined word at display
   size, its details on the same baseline. Phones, which cannot run
   Syllune, get Copy link and a line saying why. */
.get {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s1) var(--s3);
}

.get .get-link,
.get .get-copy {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--t-display);
  font-weight: var(--t-display-weight);
  line-height: var(--t-display-leading);
  letter-spacing: var(--t-display-tracking);
  text-decoration-line: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
  cursor: pointer;
  transition: text-decoration-thickness var(--dur-press) var(--ease-out);
}

.get .get-link:focus-visible,
.get .get-copy:focus-visible {
  text-decoration-thickness: 0.1em;
}

@media (hover: hover) {
  .get .get-link:hover,
  .get .get-copy:hover {
    text-decoration-thickness: 0.1em;
  }
}

.get-copy,
.get-meta-phone {
  display: none;
}

.get-meta {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

@media (hover: none) and (pointer: coarse) {
  .js .get .get-link,
  .js .get-meta-pc {
    display: none;
  }

  .js .get .get-copy {
    display: inline;
  }

  .js .get-meta-phone {
    display: inline;
  }
}

/* ================================================================= motion */
/* Reduced motion: every moving thing shows its finished state. */

@media (prefers-reduced-motion: reduce) {
  .section *,
  .section *::before,
  .section *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
