/* ============================================================
   TemplateWave — shared theme (light editorial studio)
   Loaded on every public page. Defines design tokens + the
   shared chrome: topbar, footer, buttons, eyebrow, cards.
   ============================================================ */

:root {
  /* paper + ink */
  --bg:        #f5f4ef;   /* warm off-white page */
  --surface:   #ffffff;   /* cards / panels */
  --surface-2: #efeee7;   /* subtle alt fill */
  --ink:       #1b1b18;   /* near-black, warm */
  --ink-2:     #44443d;   /* secondary text */
  --muted:     #7a766b;   /* muted text */
  --line:      #e4e1d7;   /* hairline border */
  --line-2:    #d4d0c3;   /* stronger border */

  /* single accent — terracotta / clay */
  --accent:     #bf4d2f;
  --accent-d:   #a23d22;
  --accent-soft:#f4e6df;

  /* feedback */
  --good:      #3f7d5a;
  --good-soft: #e4efe6;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow:    0 16px 40px rgba(27,27,24,.07);
  --shadow-sm: 0 4px 16px rgba(27,27,24,.05);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; color: var(--ink); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Eyebrow label (replaces the old ● badge pills) ───────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--accent); opacity: .55;
}
.eyebrow.center { justify-content: center; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-d); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface); }
.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

/* ── Tags ─────────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-family: var(--font-display); font-size: .7rem; font-weight: 500; letter-spacing: .03em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.tag.accent { background: var(--accent-soft); color: var(--accent-d); border-color: transparent; }
.tag.good   { background: var(--good-soft); color: var(--good); border-color: transparent; }

/* ── Topbar / nav ─────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  background: rgba(245,244,239,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s ease, background .25s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(245,244,239,.9); }
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 70px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.22rem;
  letter-spacing: -0.03em; color: var(--ink);
}
.logo .mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo .mark svg { width: 16px; height: 16px; }
.logo b { font-weight: 700; }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav > a {
  font-size: .92rem; color: var(--ink-2); font-weight: 500;
  padding: 8px 14px; border-radius: 999px; transition: color .18s, background .18s;
}
.topnav > a:hover { color: var(--ink); background: rgba(27,27,24,.05); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* language toggle */
.lang-toggle {
  font-family: var(--font-display); font-weight: 600; font-size: .8rem;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: border-color .18s, color .18s;
}
.lang-toggle:hover { border-color: var(--ink); color: var(--ink); }

/* signed-in chip (filled by authnav.js into [data-tw-auth]) */
.tw-auth { display: inline-flex; align-items: center; }
.tw-auth a, .tw-auth .tw-chip {
  font-family: var(--font-display); font-size: .9rem; font-weight: 500; color: var(--ink-2);
}

/* hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.hamburger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

.mobile-menu {
  display: none; position: fixed; inset: 70px 0 auto 0; z-index: 899;
  background: var(--bg); border-bottom: 1px solid var(--line); padding: 18px 24px 24px;
  flex-direction: column; gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 12px 14px; border-radius: 10px; font-size: 1rem; color: var(--ink); font-weight: 500; }
.mobile-menu a:hover { background: var(--surface-2); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 34px; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand p { font-size: .9rem; color: var(--muted); line-height: 1.7; max-width: 290px; margin-top: 14px; }
.footer-social { display: flex; gap: 8px; margin-top: 20px; }
.footer-social span {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
  color: var(--muted); background: var(--surface); cursor: pointer; transition: .18s;
}
.footer-social span:hover { border-color: var(--ink); color: var(--ink); }
.footer-col h5 { font-family: var(--font-display); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col ul a { font-size: .92rem; color: var(--ink-2); transition: color .18s; }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 26px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: .84rem; color: var(--muted); }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: .84rem; color: var(--muted); }
.footer-bottom-links a:hover { color: var(--ink); }

/* ── Scroll to top ────────────────────────────────────────── */
#scrollTop {
  position: fixed; bottom: 28px; right: 28px; z-index: 880;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s;
}
#scrollTop.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ── Reveal-on-scroll ─────────────────────────────────────── */
@keyframes riseIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
html.js .reveal { opacity: 0; }   /* only hide when JS is active, so content never stays invisible */
.reveal.in { animation: riseIn .6s cubic-bezier(.2,.7,.3,1) forwards; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; animation: none !important; } }

/* ── Responsive chrome ────────────────────────────────────── */
@media (max-width: 900px) {
  .topnav, .nav-actions .lang-toggle, .nav-actions .tw-auth, .nav-actions .btn { display: none; }
  .nav-actions .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
