/* ROOTS — The Platform
   Design system: "session floor"
   Warm near-black, bone ink, per-artist gel accents. Sharp corners. Big type, big pictures. */

:root {
  /* Neutrals (warm-tinted, soil) */
  --bg: #100f0c;
  --surface: #17150f;
  --raised: #1e1b13;
  --line: rgba(230, 221, 199, 0.14);
  --line-strong: rgba(230, 221, 199, 0.28);

  /* Ink (bone, from the wordmark) */
  --ink: #e6ddc7;
  --ink-muted: #b1a78d;
  --ink-faint: #7e7560;

  /* Gels (set lighting, one per artist) */
  --gel-blue: #4f6bff;
  --gel-amber: #ff9633;
  --gel-magenta: #ff4fc3;
  --gel-green: #3fd27f;
  --gel: var(--gel-blue);

  /* Type. Kanit and Noto Sans Thai carry the Thai glyphs the Latin faces lack. */
  --font-display: "Barlow Condensed", "Kanit", "Arial Narrow", sans-serif;
  --font-body: "Archivo", "Noto Sans Thai", "Helvetica Neue", Helvetica, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5625rem;
  --text-2xl: 1.953rem;

  /* Space (8px grid) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-8: 3rem;
  --sp-10: 4rem;
  --sp-12: 6rem;

  --radius: 2px;
  --container: 76rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Type ---------- */

.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0;
}

h1.display { font-size: clamp(3.5rem, 10vw, 8rem); }
h2.display { font-size: clamp(2.25rem, 5.5vw, 4rem); }
.section-head h1.display { font-size: clamp(2.25rem, 5.5vw, 4rem); }
h3.display { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.lead { font-size: var(--text-lg); line-height: 1.5; max-width: 42ch; }

p { max-width: 65ch; }
.muted { color: var(--ink-muted); }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.section { padding: var(--sp-12) 0; }
.section--tight { padding: var(--sp-10) 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  border-top: 1px solid var(--line-strong);
  padding-top: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.section-head .num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--ink-faint);
}
.section-head .spacer { flex: 1; }
.section-head .more {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.2s;
}
.section-head .more:hover { color: var(--ink); }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
  height: 4rem;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.logo .wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}
.logo svg { display: block; }

.nav-links {
  display: flex;
  gap: var(--sp-5);
  list-style: none;
  flex: 1;
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  transition: color 0.15s;
}
.nav-dropdown-btn:hover, .nav-dropdown-btn[aria-current="page"] { color: var(--ink); }
.nav-dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + var(--sp-3));
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  list-style: none;
  min-width: 12rem;
  display: none;
  z-index: 20;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown--hover::before {
  /* Invisible bridge over the visual gap above the menu (menu's
     top: calc(100% + sp-3)), so the pointer stays "inside" .nav-dropdown--hover
     while moving from the trigger down into the menu, instead of the hover
     state dropping in the empty space on the way there. */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--sp-3);
}
@media (hover: hover) {
  .nav-dropdown--hover:hover .nav-dropdown-menu { display: block; }
}
.nav-dropdown-menu a {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink-muted);
  padding: var(--sp-2) var(--sp-3);
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown-menu a:hover, .nav-dropdown-menu a[aria-current="page"] { color: var(--ink); background: rgba(230, 221, 199, 0.06); }

.nav-actions { display: flex; align-items: center; gap: var(--sp-4); }

.lang {
  position: relative;
}
.lang-btn {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink-muted); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--sp-2));
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  list-style: none;
  min-width: 11rem;
  display: none;
}
.lang.open .lang-menu { display: block; }
.lang-menu button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
}
.lang-menu button:hover { color: var(--ink); background: rgba(230, 221, 199, 0.06); }
.lang-menu button[aria-checked="true"] { color: var(--ink); }
.lang-menu .soon { float: right; font-size: var(--text-xs); color: var(--ink-faint); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  padding: var(--sp-2);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: var(--text-lg);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + 2px);
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gel); outline-offset: 2px; }

.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: #f2ead6; }

.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

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

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 4%, rgba(16, 15, 12, 0.55) 40%, rgba(16, 15, 12, 0.25) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-5) var(--sp-10);
}
.hero-content .eyebrow { color: var(--ink); margin-bottom: var(--sp-3); }
.hero-content .lead { margin: var(--sp-5) 0 var(--sp-6); color: var(--ink); }
.hero-cta { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* ---------- Marquee ---------- */

.marquee {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  overflow: hidden;
  padding: var(--sp-3) 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  animation: marquee 28s linear infinite;
}
.marquee span {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: var(--text-xl);
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-right: var(--sp-6);
}
.marquee span b { color: var(--ink); font-weight: 800; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.25s;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line), 0 8px 40px -12px color-mix(in srgb, var(--gel) 55%, transparent);
}
.card .media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; }
.card .media img, .card .media video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.card:hover .media img { transform: scale(1.04); }
.card .media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(16, 15, 12, 0.65), transparent 45%);
  pointer-events: none;
}
.card .body { padding: var(--sp-4); }
.card .tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gel);
  margin-bottom: var(--sp-2);
}
.card .title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: var(--text-xl);
  text-transform: uppercase;
  line-height: 1;
}
.card .meta { font-size: var(--text-sm); color: var(--ink-muted); margin-top: var(--sp-2); }

.gel-blue { --gel: var(--gel-blue); }
.gel-amber { --gel: var(--gel-amber); }
.gel-magenta { --gel: var(--gel-magenta); }
.gel-green { --gel: var(--gel-green); }

/* ---------- Grids ---------- */

.grid { display: grid; gap: var(--sp-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Horizontal strip (carousel) ---------- */

.strip {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--sp-3);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.strip > * { flex: 0 0 18rem; scroll-snap-align: start; }

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

.footer {
  border-top: 1px solid var(--line-strong);
  margin-top: var(--sp-12);
  padding: var(--sp-10) 0 var(--sp-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-8);
}
.footer .wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: var(--text-2xl);
  text-transform: uppercase;
  line-height: 1;
}
.footer h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin-bottom: var(--sp-4);
}
.footer ul { list-style: none; display: grid; gap: var(--sp-2); }
.footer ul a { color: var(--ink-muted); font-size: var(--text-sm); transition: color 0.15s; }
.footer ul a:hover { color: var(--ink); }

.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.newsletter { margin-top: var(--sp-5); max-width: 26rem; }
.newsletter label { display: block; font-size: var(--text-sm); color: var(--ink-muted); margin-bottom: var(--sp-2); }
.newsletter .row { display: flex; gap: var(--sp-2); }
.newsletter input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-3);
}
.newsletter input:focus-visible { outline: 2px solid var(--gel); outline-offset: 1px; }
.newsletter .btn { font-size: var(--text-base); padding: var(--sp-3) var(--sp-4); }

.footer-bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* ---------- Forms ---------- */

.field { margin-bottom: var(--sp-5); }
.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--sp-3);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--gel);
  outline-offset: 1px;
}
.field .help { font-size: var(--text-sm); color: var(--ink-faint); margin-top: var(--sp-2); }

/* ---------- Reveal on scroll ---------- */

html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s, transform 0.5s; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Root tendril divider ---------- */

.tendril { color: var(--ink-faint); }

[data-href] { cursor: pointer; }

/* ---------- Portal (team + onboarding) ---------- */

.role-designer { --gel: var(--gel-amber); }
.role-filmmaker { --gel: var(--gel-blue); }
.role-photographer { --gel: var(--gel-magenta); }
.role-producer { --gel: var(--gel-green); }
.role-editor { --gel: var(--ink-muted); }

.chip {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gel);
  border: 1px solid color-mix(in srgb, var(--gel) 55%, transparent);
  border-radius: var(--radius);
  padding: 2px var(--sp-2);
}

.slot-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
}
.slot-row .count { font-size: var(--text-sm); color: var(--ink-muted); margin-left: auto; }
.slot-row .btn { font-size: var(--text-base); padding: var(--sp-2) var(--sp-3); }
.slot-row.full .count { color: var(--ink-faint); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.filter-bar .chip {
  cursor: pointer;
  background: none;
  font-family: var(--font-body);
}
.filter-bar .chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.filter-bar select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
}
.filter-bar select:focus-visible { outline: 2px solid var(--gel); outline-offset: 1px; }
.filter-bar .date-field {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.filter-bar .date-field input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
  color-scheme: dark;
}
.filter-bar .date-field input:focus-visible { outline: 2px solid var(--gel); outline-offset: 1px; }
#pf-clear { cursor: pointer; background: none; font-family: var(--font-body); }

.inline-form { display: flex; gap: var(--sp-2); align-items: center; }
.inline-form input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
  width: 11rem;
}
.inline-form input:focus-visible { outline: 2px solid var(--gel); outline-offset: 1px; }

.check-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.check-row label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
}
.check-row input { accent-color: var(--ink); }

.notice {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gel);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  max-width: 46rem;
}

.manage-list { display: grid; gap: var(--sp-3); }
.manage-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--sp-3) var(--sp-4);
}
.manage-row .who { font-weight: 600; }
.manage-row .meta { font-size: var(--text-sm); color: var(--ink-muted); }
.manage-row .spacer { flex: 1; }
.manage-row .btn { font-size: var(--text-sm); padding: var(--sp-2) var(--sp-3); }

/* Project workspace */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
@media (max-width: 56rem) { .work-grid { grid-template-columns: 1fr; } }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--sp-5);
}
.panel > h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: var(--text-xl);
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.map-embed {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  border-radius: var(--radius);
  filter: saturate(0.7) brightness(0.85);
}
.map-none {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-size: var(--text-sm);
}
.map-links { display: flex; gap: var(--sp-4); margin-top: var(--sp-3); font-size: var(--text-sm); }
.map-links a { color: var(--gel); font-weight: 600; }
.map-links a:hover { color: var(--ink); text-decoration: underline; }

.tasklist { list-style: none; display: grid; gap: var(--sp-1); }
.tasklist li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--line);
}
.tasklist li:first-child { border-top: 0; }
.tasklist input[type="checkbox"] { accent-color: var(--gel); width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.tasklist .txt { flex: 1; font-size: var(--text-sm); }
.tasklist li.done .txt { color: var(--ink-faint); text-decoration: line-through; }
.tasklist .rm { background: none; border: 0; color: var(--ink-faint); cursor: pointer; font-size: var(--text-base); padding: 0 var(--sp-2); }
.tasklist .rm:hover { color: var(--ink); }
.task-add { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.task-add input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
}
.task-add input:focus-visible { outline: 2px solid var(--gel); outline-offset: 1px; }
.task-add .btn { font-size: var(--text-base); padding: var(--sp-2) var(--sp-3); }

.thread { display: grid; gap: var(--sp-3); max-height: 24rem; overflow-y: auto; margin-bottom: var(--sp-4); }
.msg { border-left: 2px solid var(--line-strong); padding-left: var(--sp-3); }
.msg .head { display: flex; gap: var(--sp-3); align-items: baseline; }
.msg .who { font-weight: 600; font-size: var(--text-sm); }
.msg .when { font-size: var(--text-xs); color: var(--ink-faint); }
.msg .body { font-size: var(--text-sm); color: var(--ink-muted); margin-top: 2px; }
.msg-form { display: grid; gap: var(--sp-2); }
.msg-form .row { display: flex; gap: var(--sp-2); }
.msg-form input, .msg-form textarea {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
}
.msg-form input { width: 11rem; }
.msg-form textarea { width: 100%; resize: vertical; min-height: 3rem; }
.msg-form input:focus-visible, .msg-form textarea:focus-visible { outline: 2px solid var(--gel); outline-offset: 1px; }

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}
.gate-card {
  width: 100%;
  max-width: 20rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
}

/* ---------- Signup popup ---------- */

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(16, 15, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}
.popup-overlay[hidden] { display: none; }
.popup-modal {
  position: relative;
  width: 100%;
  max-width: 24rem;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
}
.popup-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  background: none;
  border: 0;
  color: var(--ink-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: var(--sp-2);
  transition: color 0.15s;
}
.popup-close:hover { color: var(--ink); }
.popup-heading { font-size: var(--text-2xl); margin-top: var(--sp-2); }
.popup-sub { color: var(--ink-muted); font-size: var(--text-sm); margin-top: var(--sp-2); margin-bottom: var(--sp-5); }
.popup-disclaimer { color: var(--ink-faint); font-size: var(--text-xs); margin-top: var(--sp-3); }

/* Override the ConvertKit embed's own inline styling to match the site,
   since ck.5.js can inject its own CSS for the form's data-uid at runtime. */
.roots-popup-form .formkit-fields { display: flex; flex-direction: column; gap: var(--sp-3); }
.roots-popup-form .formkit-field { margin: 0 !important; }
.roots-popup-form .formkit-input {
  width: 100% !important;
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  color: var(--ink) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
  font-weight: 400 !important;
  padding: 0.75rem 1rem !important;
}
.roots-popup-form .formkit-input::placeholder { color: var(--ink-faint) !important; opacity: 1 !important; }
.roots-popup-form .formkit-input:focus { outline: none; border-color: var(--ink-muted) !important; }
.roots-popup-form .formkit-submit {
  width: 100% !important;
  margin-top: var(--sp-2) !important;
  background: var(--ink) !important;
  color: var(--bg) !important;
  border-radius: var(--radius) !important;
  font-family: var(--font-body) !important;
}
.roots-popup-form .formkit-submit:hover { background: #f2ead6 !important; }
.roots-popup-form .formkit-submit > span { padding: 0.75rem 1.5rem !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--text-sm); }
.roots-popup-form .formkit-alert { background: transparent; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-muted); font-size: var(--text-sm); padding: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-3) 0; text-align: left; }
.roots-popup-form .formkit-alert:empty { display: none; }
.roots-popup-form .formkit-alert-success { background: transparent; border-color: var(--line-strong); color: var(--ink); }

/* Thai script: no wide tracking (stacked vowels and tone marks), taller display leading. */
html[lang="th"] .eyebrow, html[lang="th"] .tag, html[lang="th"] .more,
html[lang="th"] .backlink, html[lang="th"] .nav-links a { letter-spacing: 0.04em; }
html[lang="th"] .display { line-height: 1.25; }
html[lang="th"] .marquee span { line-height: 1.3; }

/* ---------- Responsive ---------- */

@media (max-width: 56rem) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .nav-links {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
    flex-direction: column;
    gap: 0;
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: var(--sp-3) 0; font-size: var(--text-base); }
  .nav-toggle { display: block; }
  .nav-dropdown-btn { display: block; width: 100%; text-align: left; padding: var(--sp-3) 0; font-size: var(--text-base); }
  .nav-dropdown-menu { position: static; background: none; border: 0; border-radius: 0; min-width: auto; margin: 0 0 var(--sp-2) var(--sp-3); padding: 0; }
  .nav-dropdown-menu a { padding: var(--sp-2) 0; font-size: var(--text-base); }
}

@media (max-width: 36rem) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--sp-10) 0; }
  .hero { min-height: 72vh; }
  .strip > * { flex-basis: 15rem; }
  .footer-bottom { flex-direction: column; }
}

/* Portal title links inherit their card's ink */
.project-card .title a, .proj-block .head .title a, .manage-row .who a { color: inherit; }
.project-card .title a:hover, .proj-block .head .title a:hover { color: var(--gel); }
.proj-block .head .more { margin-left: var(--sp-2); }


/* ============================================================
   REAL ROOTS LOGO - header + footer
   Added 2026-07-29.
   Replaces the typeset "Roots" wordmark + 5-strand tendril with
   the actual brand mark (oblique wordmark + full root system +
   THE PLATFORM).

   The .logo anchor already carries aria-label, so visually
   hiding the text keeps the accessible name intact.
   ============================================================ */

.logo .wordmark,
.footer .wordmark {
  display: block;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
  background: url("../assets/img/roots-logo.png") no-repeat center / contain;
}

.logo .wordmark   { width: 151px; height: 50px; }
.footer .wordmark { width: 262px; height: 87px; }

.logo .tendril,
.footer .tendril { display: none; }

@media (max-width: 640px) {
  .logo .wordmark { width: 133px; height: 44px; }
}
