/* ============================================================
   Matholog — web design system
   One stylesheet for every page. Tokens first, components after.
   Brand: Aegean teal + coral on warm paper (dark mode included).
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* surfaces */
  --paper:      #FAF6EF;   /* warm cream — the notebook page */
  --card:       #FFFFFF;
  --tint:       #EEF4F6;   /* teal-washed band background */
  --line:       rgba(34, 48, 58, 0.14);

  /* ink */
  --ink:        #22303A;   /* deep blue-slate, never pure black */
  --muted:      #5C6B76;

  /* brand */
  --teal:       #27718F;   /* primary — Aegean */
  --teal-deep:  #1D5A73;
  --coral:      #FF5079;   /* secondary — the elastic band */
  --terracotta: #BC6438;   /* warm highlight, use sparingly */

  /* type */
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* rhythm */
  --radius: 14px;
  --radius-lg: 24px;
  --gap: clamp(20px, 4vw, 36px);
  --section: clamp(64px, 10vw, 120px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #131A20;
    --card:   #1B242C;
    --tint:   #182530;
    --line:   rgba(233, 238, 242, 0.14);
    --ink:    #E9EEF2;
    --muted:  #9AA7B0;
    --teal:   #4FA3C4;   /* lifted for contrast on dark */
    --teal-deep: #78BCD6;
    --coral:  #FF6E8F;
    --terracotta: #D98B5F;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.06rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--coral); color: #fff; }

a { color: var(--teal); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--teal-deep); }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

img, svg { max-width: 100%; height: auto; }

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

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

/* ---------- Header ---------- */
.site-header {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.wordmark {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.wordmark svg { width: 30px; height: 30px; flex: none; }
.wordmark .log { color: var(--coral); }  /* Matho·log — the record made visible */

.site-nav { display: flex; gap: clamp(14px, 3vw, 28px); }
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.98rem;
}
.site-nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--section);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--gap);
  align-items: center;
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-block: clamp(48px, 8vw, 80px); }
  .hero-art { order: -1; max-width: 230px; margin-inline: auto; }
}

.hero .kicker {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 14px;
}
.hero p.lede {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 34em;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; align-items: center; }

.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 1rem;
}
.badge-soon .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral);
}

.link-quiet { font-weight: 500; }

/* the notebook illustration */
.hero-art { position: relative; }
.hero-art svg {
  display: block;
  transform: rotate(-4deg);
  filter: drop-shadow(0 18px 30px rgba(29, 90, 115, 0.25));
}

/* gentle entrance — guarded for motion sensitivity */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 0.7s ease-out both; }
  .hero > *:nth-child(2) { animation-delay: 0.12s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  .hero-art { animation: rise 0.7s ease-out 0.12s both; }
}

/* ---------- The -λόγιο story (dictionary moment) ---------- */
.story {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
  text-align: center;
}
.logio-list {
  list-style: none;
  padding: 0;
  margin: 34px 0;
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logio-list li { color: var(--muted); opacity: 0.6; padding: 3px 0; }
.logio-list li:nth-child(2) { opacity: 0.72; }
.logio-list li:nth-child(3) { opacity: 0.84; }
.logio-list li:nth-child(4) { opacity: 0.95; }
.logio-list li.coined {
  color: var(--teal);
  opacity: 1;
  font-size: 1.25em;
  padding-top: 10px;
}

.dictionary-card {
  max-width: 560px;
  margin: 36px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  text-align: left;
  box-shadow: 0 10px 28px rgba(34, 48, 58, 0.06);
}
.dictionary-card .headword { font-size: 1.5rem; font-weight: 700; }
.dictionary-card .pos { font-style: italic; color: var(--muted); margin-left: 8px; font-size: 0.95rem; }
.dictionary-card .phon { font-family: var(--mono); color: var(--terracotta); font-size: 0.92rem; margin: 4px 0 14px; }
.dictionary-card .sense { margin: 0; }
.dictionary-card .sense strong { color: var(--teal); }

/* ---------- Features ---------- */
.features {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(34, 48, 58, 0.09);
  }
}
.feature .glyph {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--tint);
  color: var(--teal);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.feature .glyph svg { width: 22px; height: 22px; }
.feature p { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* ---------- Privacy band ---------- */
.privacy-band {
  background: var(--tint);
  border-block: 1px solid var(--line);
  padding-block: clamp(40px, 6vw, 64px);
  text-align: center;
}
.privacy-band h2 { margin-bottom: 10px; }
.privacy-band p { max-width: 44em; margin-inline: auto; color: var(--muted); }

/* ---------- Closing CTA ---------- */
.closing {
  padding-block: var(--section);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 34px;
  font-size: 0.94rem;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* ---------- Article pages (privacy, future help/press) ---------- */
.article {
  max-width: 720px;
  margin-inline: auto;
  padding-block: clamp(48px, 7vw, 80px);
}
.article h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.article h2 {
  font-size: 1.35rem;
  margin-top: 2.2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}
.article .effective {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--terracotta);
  margin-bottom: 2em;
}
.article ul { padding-left: 1.3em; }
.article li { margin-bottom: 0.4em; }
.article .lang-divider {
  margin-top: 3.5em;
  padding-top: 2.5em;
  border-top: 3px double var(--line);
}
.backlink {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 500;
}
