/* nuttig.app — homepage styles
   Design system: dark default, light alternate, type-driven, generous space.
   Brackets [ ... ] are the consistent interactive marker across the whole site.
   Type pairing: Nunito (display) + ui-monospace (body, native SF Mono on Apple). */

/* -------------------------------------------------------------------------
   Tokens — colours, type, spacing
   ------------------------------------------------------------------------- */

:root {
  /* Dark theme (default).
     Contrast ratios verified against #0a0a0a bg:
       text       18.1:1 (AAA)
       text-muted  9.0:1 (AAA — used for body subtext, principle details, descriptions)
       text-faint  3.4:1 (AA Large, used only for decorative separators + disabled states) */
  --bg: #0a0a0a;
  --surface: #111;
  --text: #f4f4f1;
  --text-muted: #b8b8b0;
  --text-faint: #6a6a62;
  --hairline: #545450;
  --surface-hover: #16161a;
  --accent: #ff8c42;     /* warm — echoes the Convert app warning rule */
  --link-underline: rgba(244, 244, 241, 0.35);

  /* Type families */
  --font-display: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale (fluid) */
  --type-wordmark-hero: clamp(4rem, 18vw, 14rem);
  --type-wordmark-small: 1.5rem;
  --type-wordmark-footer: 1.25rem;
  --type-tagline: clamp(1.75rem, 5vw, 3.5rem);
  --type-subhead: clamp(1.125rem, 2vw, 1.5rem);
  --type-app-name: clamp(1.75rem, 4.5vw, 2.75rem);
  --type-app-desc: clamp(1rem, 1.4vw, 1.125rem);
  --type-approach: clamp(1.125rem, 2.2vw, 1.625rem);
  --type-body: 0.9375rem;
  --type-caption: 0.8125rem;
  --type-label: 0.75rem;

  /* Line heights */
  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-normal: 1.55;
  --lh-loose: 1.7;

  /* Tracking (letter-spacing) */
  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.12em;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --max-width: 1200px;
  --section-padding-y: clamp(6rem, 14vh, 12rem);
  --hero-padding-y: clamp(4rem, 10vh, 8rem);
}

/* Light theme override.
   Contrast ratios verified against #fafaf7 bg:
     text       17.8:1 (AAA)
     text-muted  7.4:1 (AAA)
     text-faint  3.5:1 (AA Large, decorative + disabled only) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafaf7;
    --surface: #efefe8;
    --text: #16160f;
    --text-muted: #525248;
    --text-faint: #8a8a82;
    --hairline: #a0a098;
    --surface-hover: #f1f1ea;
    --accent: #d65a14;
    --link-underline: rgba(22, 22, 15, 0.35);
  }
}

/* -------------------------------------------------------------------------
   Reset + base
   ------------------------------------------------------------------------- */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--type-body);
  line-height: var(--lh-normal);
  font-feature-settings: 'liga' on, 'kern' on;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 0.2em;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

hr { border: 0; margin: 0; }

ul { list-style: none; padding: 0; margin: 0; }

p, h1, h2, h3 { margin: 0; }

/* -------------------------------------------------------------------------
   Skip link (a11y)
   ------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: var(--type-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.skip-link:focus {
  top: 1rem;
}

/* -------------------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------------------- */

.site-header,
.section,
.site-footer,
.hero {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  padding-top: var(--space-8);
  padding-bottom: 0;
}

.hero,
.section {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* -------------------------------------------------------------------------
   Wordmark
   ------------------------------------------------------------------------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.wordmark--small {
  font-size: var(--type-wordmark-small);
}

.wordmark--footer {
  font-size: var(--type-wordmark-footer);
}

.wordmark--hero {
  font-size: var(--type-wordmark-hero);
  margin-bottom: clamp(2rem, 5vw, 4rem);
  display: block;
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */

.hero {
  padding-top: var(--hero-padding-y);
  padding-bottom: var(--hero-padding-y);
}

.tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-tagline);
  letter-spacing: var(--tracking-snug);
  line-height: 1.1;
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem) 0;
  color: var(--text);
  max-width: 16ch;
}

.hairline-mark {
  width: 2.5rem;
  height: 1px;
  background: var(--text-muted);
  margin: clamp(1.5rem, 3vw, 2rem) 0;
}

/* Dictionary-entry subhead — explains the name in its own language pattern.
   Word in Nunito (matches brand wordmark), the rest in mono.
   Reads like a real lexicon entry: word, part-of-speech (italic), language, definition. */
.dictionary-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--type-subhead);
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  line-height: var(--lh-normal);
}

.dictionary-entry__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2em;
  letter-spacing: var(--tracking-snug);
  color: var(--text);
  margin-right: var(--space-1);
}

.dictionary-entry__pos {
  font-style: italic;
  color: var(--text-muted);
}

.dictionary-entry__lang {
  color: var(--text-muted);
  /* "Dutch" stays capitalised — proper noun. The brand lowercase rule is for the wordmark, not all text. */
}

.dictionary-entry__def {
  color: var(--text-muted);
  text-transform: lowercase;
}

.dictionary-entry__sep {
  color: var(--text-faint);
}

/* -------------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------------- */

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 1.1vw, 1rem);
  font-weight: bold;
  letter-spacing: var(--tracking-wide);
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.hairline-short {
  width: 4rem;
  height: 1px;
  background: var(--hairline);
  margin-bottom: var(--space-8);
}

.hairline-rule {
  width: 100%;
  height: 1px;
  background: var(--hairline);
  margin: var(--space-16) 0;
}

/* -------------------------------------------------------------------------
   Apps section
   ------------------------------------------------------------------------- */

/* Apps stack vertically. Each card defines its rhythm via internal padding;
   subsequent cards get a top hairline rule as a chapter mark. */
.app-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cards define their "zone" via padding + chapter-mark hairline only.
   No border, no radius (those would signal "click the card", which is wrong —
   the actual click targets are the bracketed buttons INSIDE).
   Hover gives a quiet "you're here" tonal shift, not a button affordance. */
.app-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 2.5vw, 1.5rem);
  margin: 0 calc(clamp(1rem, 2.5vw, 1.5rem) * -1);  /* extend hover area to gutter while keeping content aligned */
  transition: background-color 200ms ease;
  border-radius: 4px;
}

.app-card:hover {
  background-color: var(--surface-hover);
}

.app-card + .app-card {
  border-top: 1px solid var(--hairline);
  margin-top: 0;
}

.app-card--placeholder {
  color: var(--text-muted);
}

.app-card--placeholder .app-desc {
  font-size: var(--type-caption);
  color: var(--text-muted);
}

.app-card--placeholder:hover {
  background-color: transparent;
}

.app-card__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}

@media (min-width: 640px) {
  .app-card__row {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-6);
  }
}

.app-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.platform-glyph {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.app-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-app-name);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-tight);
  color: var(--text);
}

.app-desc {
  font-family: var(--font-mono);
  font-size: var(--type-app-desc);
  color: var(--text-muted);
  line-height: var(--lh-normal);
  max-width: 50ch;
}

.app-card--placeholder {
  font-family: var(--font-mono);
  font-size: var(--type-app-desc);
  color: var(--text-muted);
  font-style: normal;
  line-height: var(--lh-normal);
}

/* -------------------------------------------------------------------------
   Buttons (bracket markers — the interactive element pattern)
   ------------------------------------------------------------------------- */

.btn {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  letter-spacing: var(--tracking-wide);
  text-transform: lowercase;
  text-decoration: none;
  color: var(--text);
  /* WCAG 2.2 minimum tap target: 44x44 — 1rem padding + 13px text = 45px tall */
  padding: 1rem var(--space-3);
  display: inline-block;
  white-space: nowrap;
  transition: color 200ms ease;
  border-radius: 4px;
}

.btn--primary {
  color: var(--text);
}

.btn--primary:hover {
  color: var(--accent);
  text-decoration: none;
}

.btn--ghost {
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--accent);
  text-decoration: none;
}

.btn--inactive {
  color: var(--text-faint);
  cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Approach section
   ------------------------------------------------------------------------- */

.approach-paragraph {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--type-approach);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
  color: var(--text);
  max-width: 32ch;
  margin-bottom: var(--space-16);
}

.principles {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--accent);
  padding-left: var(--space-6);
  margin-bottom: var(--space-16);
  max-width: 56ch;
}

.principles__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  line-height: var(--lh-normal);
}

@media (min-width: 640px) {
  .principles__item {
    grid-template-columns: 12ch 1fr;
    gap: var(--space-6);
    align-items: baseline;
  }
}

.principles__label {
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: bold;
}

.principles__detail {
  color: var(--text-muted);
}

.studio-line {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--text-muted);
  line-height: var(--lh-normal);
  max-width: 56ch;
}

.studio-line a {
  color: var(--text);
}

/* -------------------------------------------------------------------------
   Legal pages (privacy, terms)
   Narrower max-width (~62ch) for readable prose; same type system as homepage.
   ------------------------------------------------------------------------- */

.legal {
  max-width: 64ch;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) var(--gutter) clamp(4rem, 10vh, 8rem);
}

.legal-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--hairline);
}

.legal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: var(--tracking-snug);
  line-height: 1.1;
  color: var(--text);
  margin: 0;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  margin: 0;
}

.legal-lede {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: var(--tracking-snug);
  color: var(--text);
  margin: 0 0 clamp(2.5rem, 6vh, 4rem) 0;
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent);
}

.legal-section {
  margin-bottom: clamp(2.5rem, 5vh, 3.5rem);
}

.legal-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
  color: var(--text);
  margin: 0 0 var(--space-4) 0;
}

.legal-section p {
  font-family: var(--font-mono);
  font-size: clamp(0.9375rem, 1.2vw, 1rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 var(--space-4) 0;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section strong {
  color: var(--text);
  font-weight: bold;
}

.legal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4) 0;
  font-family: var(--font-mono);
  font-size: clamp(0.9375rem, 1.2vw, 1rem);
  line-height: 1.7;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.legal-list li {
  padding-left: 1.75em;
  position: relative;
}

.legal-list li::before {
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.legal-list--no li::before {
  content: "×";
  font-size: 1.1em;
  line-height: 1.5;
  color: var(--text-faint);
}

.legal-list--yes li::before {
  content: "✓";
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--accent);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.site-footer {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  margin-top: var(--space-16);
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    gap: var(--space-16);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.eu-flag {
  font-size: 1.1em;
  line-height: 1;
}

.heart {
  color: var(--accent);
  font-size: 1.05em;
  line-height: 1;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

@media (min-width: 640px) {
  .footer-nav ul {
    align-items: flex-end;
  }
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  letter-spacing: var(--tracking-wide);
  text-transform: lowercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 200ms ease;
}

.footer-nav a:hover {
  color: var(--accent);
}
