/* ============================================================
   WAYFARE, design system
   Concept: "Register", travel documents & city wayfinding.
   Tokens only. No component declares a literal colour.
   ============================================================ */

/* ---- 1. Tokens: light (bare :root = complete palette) ---- */
:root {
  --paper:   #EDEEE9;
  --surface: #F8F8F4;
  --sunken:  #E3E5DE;
  --ink:     #14171A;
  --ink-2:   #4B5254;
  --ink-3:   #767C7D;
  --rule:    #D2D5CC;
  --rule-2:  #BFC3B9;
  --stamp:   #B3372F;
  --stamp-w: #F3E2E0;
  --navy:    #1B3A5C;
  --navy-w:  #DFE6ED;
  --focus:   #1B3A5C;

  --ff-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --ff-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ff-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;

  --s-xs: 0.72rem;  --s-sm: 0.8rem;   --s-md: 0.94rem;  --s-base: 1rem;
  --s-lg: 1.2rem;   --s-xl: 1.5rem;   --s-2xl: 1.95rem;
  --s-3xl: 2.6rem;  --s-4xl: 3.4rem;

  --gap: 1.5rem;
  --shell: 1180px;
  --radius: 2px;
}

/* ---- 2. Tokens: dark via system preference (explicit light wins) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #111417;
    --surface: #191D21;
    --sunken:  #0B0E10;
    --ink:     #E8E9E4;
    --ink-2:   #98A0A2;
    --ink-3:   #757D7F;
    --rule:    #2A3035;
    --rule-2:  #3A4249;
    --stamp:   #E0655A;
    --stamp-w: #33191A;
    --navy:    #7FA8D4;
    --navy-w:  #16232F;
    --focus:   #7FA8D4;
  }
}

/* ---- 3. Tokens: dark via explicit choice ---- */
:root[data-theme="dark"] {
  --paper:   #111417;
  --surface: #191D21;
  --sunken:  #0B0E10;
  --ink:     #E8E9E4;
  --ink-2:   #98A0A2;
  --ink-3:   #757D7F;
  --rule:    #2A3035;
  --rule-2:  #3A4249;
  --stamp:   #E0655A;
  --stamp-w: #33191A;
  --navy:    #7FA8D4;
  --navy-w:  #16232F;
  --focus:   #7FA8D4;
}

/* ---- 4. Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--s-base);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: 1.16;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }
img { max-width: 100%; display: block; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--stamp); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- 5. Utility face: everything that is *data* ---- */
.mono {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.num { font-variant-numeric: tabular-nums; }

/* ---- 6. Shell ---- */
.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.stack { display: flex; flex-direction: column; gap: var(--gap); }

/* ---- 7. Masthead ---- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-in {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--ff-mono);
  font-size: var(--s-md);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--navy); }
.wordmark .chev { color: var(--stamp); }

.mast-nav {
  display: flex;
  gap: 1.1rem;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.mast-nav a {
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.mast-nav a:hover { color: var(--stamp); }

/* language switch */
.langs { display: flex; gap: 0.3rem; align-items: center; }

.lang {
  flex: none; /* never let the switcher collapse: it is the primary control */
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.42rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.4;
}
.lang:hover { border-color: var(--navy); color: var(--navy); }
.lang[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}

/* ---- 8. The verification stamp ---- */
.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start; /* stay stamp-sized inside a stretching flex column */
  gap: 0.1rem;
  border: 1.5px solid var(--stamp);
  border-radius: var(--radius);
  padding: 0.42rem 0.6rem;
  transform: rotate(-3deg);
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stamp);
  line-height: 1.35;
  background: transparent;
}
.stamp b { font-weight: 600; }
.stamp .stamp-date { color: var(--stamp); opacity: 0.75; }

@media (prefers-reduced-motion: no-preference) {
  .stamp-reveal { animation: stampIn 480ms cubic-bezier(.2,.9,.3,1) both; }
  @keyframes stampIn {
    from { opacity: 0; transform: rotate(-9deg) scale(1.14); }
    to   { opacity: 1; transform: rotate(-3deg) scale(1); }
  }
}

/* ---- 9. Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-mono);
  font-size: var(--s-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.62rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--stamp);
  background: var(--stamp);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: filter 120ms ease;
}
.btn:hover { filter: brightness(1.1); color: var(--paper); }

.btn-quiet {
  background: transparent;
  border-color: var(--rule-2);
  color: var(--ink-2);
}
.btn-quiet:hover { border-color: var(--navy); color: var(--navy); filter: none; }

/* ---- 10. Register table (the directory) ---- */
.register-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }

table.register {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--s-md);
  min-width: 620px;
}

table.register th {
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule-2);
  white-space: nowrap;
}

table.register td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  color: var(--ink-2);
}
table.register tr:last-child td { border-bottom: 0; }
table.register tr:hover td { background: var(--sunken); }
table.register td.city { color: var(--ink); font-weight: 500; }
table.register td.city a { text-decoration: none; }
table.register td.city a:hover { text-decoration: underline; }

.flagcode {
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.08em;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  padding: 0.1rem 0.36rem;
  color: var(--ink-2);
}

/* ---- 11. Footer ---- */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  background: var(--surface);
}
.foot-in {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 2.25rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.foot p { color: var(--ink-3); font-size: var(--s-sm); max-width: 68ch; }

/* .foot p is (0,1,1); match it so the disclosure keeps its own colour there */
.disclosure,
.foot p.disclosure {
  border-left: 2px solid var(--stamp);
  padding-left: 0.9rem;
  color: var(--ink-2);
  font-size: var(--s-sm);
  max-width: 72ch;
}

/* ---- 12. Demo ribbon (removed in production) ---- */
.demo-flag {
  background: var(--navy);
  color: var(--surface);
  font-family: var(--ff-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.4rem 1rem;
}

/* ============================================================
   CREATOR LAYER, UGC blog format.
   Creators are curators with a stated taste, not correspondents.
   ============================================================ */

/* ---- Avatars: initials only. Never a photorealistic face. ---- */
.av {
  border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--navy-w); color: var(--navy);
  font-family: var(--ff-display); line-height: 1;
}
.av-s { width: 34px; height: 34px; font-size: var(--s-md); }
.av-m { width: 52px; height: 52px; font-size: var(--s-lg); }
.av-l { width: 76px; height: 76px; font-size: var(--s-2xl); }

.av-stamp { background: var(--stamp-w); color: var(--stamp); }

/* ---- The AI chip. Small, permanent, links to the method page. ---- */
.chip-ai {
  display: inline-block; font-family: var(--ff-mono); font-size: 0.62rem;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--navy);
  border: 1px solid var(--navy); border-radius: var(--radius);
  padding: 0.04rem 0.3rem; vertical-align: 2px; margin-left: 0.35rem;
  text-decoration: none; white-space: nowrap;
}
a.chip-ai:hover { background: var(--navy); color: var(--surface); }

/* ---- Creator identity line ---- */
.byline { display: flex; align-items: center; gap: 0.65rem; }
.byline-name { font-family: var(--ff-display); font-size: var(--s-lg); line-height: 1.15; color: var(--ink); }
.byline-taste {
  font-family: var(--ff-mono); font-size: var(--s-xs); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 0.16rem;
}

/* ---- Creator directory ---- */
.creator-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.creator {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.6rem;
}

/* the viewer's own creator, given room for their full criteria */
.creator-lead {
  background: var(--surface); border: 1px solid var(--rule-2); border-left: 2px solid var(--stamp);
  border-radius: var(--radius); padding: 1.4rem 1.5rem 1.5rem; margin-top: 2rem;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.creator-lead .creator-look { font-size: var(--s-base); max-width: 62ch; }
.creator-head { display: flex; gap: 0.75rem; align-items: center; }
.creator-look { font-size: var(--s-md); color: var(--ink-2); }
.creator-look b { color: var(--ink); font-weight: 500; }
.creator-stats {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.5rem;
  border-top: 1px solid var(--rule); font-family: var(--ff-mono);
  font-size: var(--s-xs); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3);
}
.creator-stats b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- Post feed ---- */
.feed { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 1rem; margin-top: 2rem; }
.post {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
  padding: 1.15rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 0.7rem;
  text-decoration: none; transition: border-color 120ms ease;
}
.post:hover { border-color: var(--navy); }
.post-city {
  font-family: var(--ff-mono); font-size: var(--s-xs); letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--stamp);
}
.post h3 { font-size: var(--s-lg); color: var(--ink); }
.post-by { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.post-by span { font-size: var(--s-sm); color: var(--ink-2); }
.post-meta {
  font-family: var(--ff-mono); font-size: var(--s-xs); letter-spacing: 0.07em;
  color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums;
}

/* ---- Featured guide (homepage hero) ---- */
.featured {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
  padding: 1.6rem 1.7rem 1.75rem; display: flex; flex-direction: column; gap: 1rem;
}
.featured h2 { font-size: clamp(1.6rem, 3.4vw, var(--s-2xl)); }
.featured-sub { color: var(--ink-2); max-width: 52ch; }

/* ---- The creator's opinion line, inside a guide entry ---- */
.pick-note {
  border-left: 2px solid var(--stamp); padding: 0.15rem 0 0.15rem 0.9rem;
  margin: 1.2rem 0; display: flex; flex-direction: column; gap: 0.3rem;
}
.pick-note .pn-k {
  font-family: var(--ff-mono); font-size: var(--s-xs); letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-3);
}
.pick-note p {
  font-family: var(--ff-display); font-size: var(--s-lg); line-height: 1.42;
  color: var(--ink); max-width: 52ch; margin: 0;
}
