/* =========================================================
   turoczy.co — see DESIGN.md
   Dots are the system: nav position, section markers, quote
   markers, hero field. Never sprinkled as texture.
   ========================================================= */

:root {
  --ash:   #E7E8E2;
  --bloom: #F3F2EC;
  --fir:   #14241E;
  --moss:  #5C7F63;
  --rose:  #B8365E;

  --ground: var(--ash);
  --surface: var(--bloom);
  --ink: var(--fir);
  --ink-quiet: #4A5C54;
  --rule: rgba(20, 36, 30, 0.14);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --rail: 11rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #10201A;
    --surface: #16291F;
    --ink: #E7E8E2;
    --ink-quiet: #9DB3A4;
    --moss: #7FA487;
    --rose: #F0708F;
    --rule: rgba(231, 232, 226, 0.16);
  }
}

:root[data-theme="dark"] {
  --ground: #10201A;
  --surface: #16291F;
  --ink: #E7E8E2;
  --ink-quiet: #9DB3A4;
  --moss: #7FA487;
  --rose: #F0708F;
  --rule: rgba(231, 232, 226, 0.16);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-color: var(--rose);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--rose); color: #fff;
  padding: 0.6rem 1rem; z-index: 99;
}
.skip:focus { left: 1rem; top: 1rem; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 1.1rem + 4.7vw, 4.75rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
}

h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

p { margin: 0 0 1.15em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink);
}

em { font-style: italic; }
strong { font-weight: 600; }

/* ---------- Dot rail nav ---------- */

.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail);
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding-left: var(--gutter);
  z-index: 20;
}

.rail a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--ink-quiet);
  text-decoration: none;
  transition: color 0.18s ease;
}

.rail a::before {
  content: "";
  width: 9px; height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  border: 1.5px solid var(--moss);
  background: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rail a:hover { color: var(--ink); }
.rail a:hover::before { background: var(--moss); }

.rail a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.rail a[aria-current="true"]::before {
  background: var(--rose);
  border-color: var(--rose);
  transform: scale(1.25);
}

@media (min-width: 62rem) {
  .rail { display: flex; }
}

.rail-social {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  width: calc(var(--rail) - var(--gutter) - 0.75rem);
  max-width: 7.5rem;
}
.rail-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border-radius: 50%;
  color: var(--ink-quiet);
  transition: color 0.18s ease, background 0.18s ease;
}
.rail-social a::before { content: none; }
.rail-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  display: block;
}
.rail-social a:hover,
.rail-social a:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--moss) 22%, transparent);
}

/* mobile: horizontal scroll strip pinned to bottom */
.strip {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.75rem var(--gutter);
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
}
.strip::-webkit-scrollbar { display: none; }
.strip a {
  white-space: nowrap;
  color: var(--ink-quiet);
  text-decoration: none;
}
.strip-social {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: -0.6rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule);
}
.strip-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-quiet);
  transition: color 0.18s ease, background 0.18s ease;
}
.strip-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}
.strip-social a:hover,
.strip-social a:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--moss) 22%, transparent);
}

.strip a[aria-current="true"] {
  color: var(--rose);
  font-weight: 600;
}
@media (min-width: 62rem) {
  .strip { display: none; }
}

/* ---------- Shell ---------- */

.shell {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  padding-bottom: 5rem;
}
@media (min-width: 62rem) {
  .shell {
    padding-left: calc(var(--rail) + var(--gutter));
    padding-right: var(--gutter);
  }
}

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

.hero {
  position: relative;
  min-height: 86svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(3rem, 7vh, 4.5rem);
  padding-bottom: clamp(2rem, 5vh, 3.25rem);
}

.hero-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-field svg { width: 100%; height: 100%; }

/* Collecting, then connecting. Dots arrive one at a time and stay; some
   of them later get joined and stay joined. Nothing here is ever undone
   — the field only accumulates. */
.hero-field circle {
  fill: var(--moss);
  opacity: 0.4;
  transition: fill 1.4s ease, opacity 1.4s ease;
}

/* A collected dot: absent, then present, then permanent. */
.hero-field circle.node {
  opacity: 0;
  r: 0;
  transition: opacity 1.3s ease,
              r 1.3s cubic-bezier(0.34, 1.32, 0.5, 1),
              fill 1.4s ease;
}
.hero-field circle.node.shown  { opacity: 0.62; r: 3;   fill: var(--moss); }
.hero-field circle.node.linked { opacity: 0.7;  r: 3.6; fill: var(--rose); }
.hero-field circle.node.active { opacity: 1;    r: 5;   fill: var(--rose); }

/* Edges are drawn by js/site.js, roughly one every couple of seconds.
   Each one flares as it lands, then fades back to a resting weight and
   stays there. Over a minute or so the field becomes a matrix. */
.hero-field line {
  stroke: var(--rose);
  stroke-width: 1.25;
  opacity: 0;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 2.2s cubic-bezier(0.32, 0.72, 0.3, 1),
              opacity 1.6s ease, stroke-width 1.6s ease;
}
.hero-field line.draw { opacity: 0.62; stroke-dashoffset: 0; }
.hero-field line.settled {
  opacity: 0.24;
  stroke-width: 1;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-field circle, .hero-field line { transition: none; }
}

/* Narrow screens: connections have nowhere to live without crowding the
   headline, so keep only the quiet ambient dots. */
@media (max-width: 62rem) {
  .hero-field { opacity: 0.6; }
  .hero-field line { display: none; }
}

.hero-inner { position: relative; z-index: 1; }

.wordmark {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0 0 clamp(0.9rem, 3vh, 1.75rem);
  color: var(--ink);
}
.wordmark span { color: var(--ink-quiet); font-weight: 400; }

.hero h1 {
  max-width: 16ch;
  margin-bottom: 1.05rem;
}
.hero h1 .quiet {
  color: var(--ink-quiet);
}

/* The standing tagline. It explains the dots, so it sits where the
   dots are moving. */
.tagline {
  font-family: var(--display);
  font-variation-settings: "SOFT" 70, "WONK" 1;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.15rem, 0.95rem + 0.95vw, 1.75rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
  max-width: 28ch;
  margin: 0 0 1.2rem;
  color: var(--moss);
  text-wrap: balance;
}

.hero .lede {
  max-width: 50ch;
  margin-bottom: 1.6rem;
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  position: fixed;
  top: clamp(0.85rem, 2vh, 1.5rem);
  right: clamp(0.85rem, 2vw, 1.75rem);
  top: calc(clamp(0.85rem, 2vh, 1.5rem) + env(safe-area-inset-top, 0px));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.8rem 0.5rem 0.6rem;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-quiet);
  font-family: var(--body);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--moss); }

/* The icon is a dot, half filled — same vocabulary as the rest. */
.theme-toggle svg { width: 15px; height: 15px; flex: 0 0 15px; }
.theme-toggle .ring { fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme-toggle .half { fill: currentColor; }

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 0.95rem 1.75rem;
  border: 1.5px solid var(--rose);
  border-radius: 999px;          /* same pill as the index chips */
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.btn-solid { background: var(--rose); color: #FFF7F9; }
.btn-solid:hover { background: transparent; color: var(--rose); }

.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--ground); }

.btn-note {
  font-size: 0.9rem;
  color: var(--ink-quiet);
  max-width: 52ch;
  margin: 1rem 0 0;
}

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

.section {
  padding-block: clamp(3.5rem, 9vh, 7rem);
  border-top: 1px solid var(--rule);
}

.section-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 3rem);
}
@media (min-width: 62rem) {
  .section-grid {
    grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr);
    align-items: start;
  }
}

.section-head { position: relative; }

.section-head h2 {
  position: sticky;
  top: 2.5rem;
}

.section-body > :first-child { margin-top: 0; }

/* ---------- Talks ---------- */

.talks {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  max-width: var(--measure);
}

.talks li {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.talks li:last-child { border-bottom: 1px solid var(--rule); }

.talks h3 { margin-bottom: 0.45rem; font-size: 1.2rem; }
.talks p { margin: 0; color: var(--ink-quiet); }

.talk-where {
  font-size: 0.85rem;
  color: var(--moss);
  margin-top: 0.5rem !important;
}

/* ---------- Stages ---------- */

.stages {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  max-width: var(--measure);
}

.stages li {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 0.85rem;
  align-items: baseline;
}
.stages li::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--moss);
  transform: translateY(-0.15em);
}
.stages b { font-weight: 600; }
.stages span { color: var(--ink-quiet); }

/* ---------- Quotes ---------- */

.quotes {
  margin: 0 0 2rem;
  padding: 0;
  max-width: var(--measure);
}

.quotes blockquote {
  margin: 0 0 1.6rem;
  padding-left: 1.6rem;
  border-left: 2px solid var(--rose);
}

.quotes q {
  font-family: var(--display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.28;
  quotes: "“" "”";
}

.quotes cite {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--body);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-quiet);
}

.press {
  font-size: 0.95rem;
  color: var(--ink-quiet);
  max-width: var(--measure);
}

/* ---------- Pull quote (design accent) ---------- */

.pull {
  font-family: var(--display);
  font-variation-settings: "SOFT" 70, "WONK" 1;
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.pull em { color: var(--rose); font-style: normal; }

/* ---------- Bot slot ---------- */

.bot-slot {
  margin-top: 1.75rem;
  border: 1.5px dashed var(--moss);
  background: var(--surface);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: var(--measure);
}
.bot-slot p { margin-bottom: 0; color: var(--ink-quiet); font-size: 0.95rem; }
.bot-slot p:first-child {
  font-family: var(--display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

/* ---------- Contact ---------- */

.contact-list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
  font-size: 1.05rem;
}

.social-list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.95rem;
}
.social-list a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-quiet);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.social-list a:hover,
.social-list a:focus-visible {
  color: var(--ink);
  border-color: currentColor;
}

footer.foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 6rem;
  font-size: 0.875rem;
  color: var(--ink-quiet);
}
@media (min-width: 62rem) {
  footer.foot { padding-bottom: 3rem; }
}

/* ---------- CV ---------- */

.cv-group {
  font-family: var(--display);
  font-variation-settings: "SOFT" 50, "WONK" 1;
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 2.75rem 0 0.25rem;
  color: var(--ink);
}

.cv {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 54rem;
}

.cv li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 46rem) {
  .cv li {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0 1.5rem;
  }
}

.cv-org { font-weight: 600; }
.cv-role { color: var(--ink-quiet); }
.cv-when {
  color: var(--moss);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ---------- The index ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.75rem 0 0.5rem;
}

.chip {
  font-family: var(--body);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.55rem 0.9rem;
  color: var(--ink-quiet);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--moss); }
.chip[aria-pressed="true"] {
  color: var(--ground);
  background: var(--ink);
  border-color: var(--ink);
}

.ix-group[hidden] { display: none; }

.ix-title {
  font-family: var(--display);
  font-variation-settings: "SOFT" 50, "WONK" 1;
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 2.75rem 0 0.25rem;
}

.ix {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 56rem;
}

.ix li {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 0 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
@media (max-width: 34rem) {
  .ix li { grid-template-columns: 1fr; gap: 0.15rem; }
}

.ix-yr {
  color: var(--moss);
  font-size: 0.82rem;
  line-height: 1.5;
}
.ix-what { line-height: 1.5; }
.ix-what i { font-style: italic; }

.ix-link {
  font-size: 0.82rem;
  color: var(--rose);
  white-space: nowrap;
}

.ix-note {
  margin-top: 2.25rem;
  font-size: 0.9rem;
  color: var(--ink-quiet);
}

/* An index entry is the link — no trailing "link" word. */
.ix-entry {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rose) 55%, transparent);
  text-underline-offset: 0.16em;
}
.ix-entry:hover { text-decoration-color: var(--rose); }

/* Leaves the page, so it is marked as leaving the page. */
.rail .nav-out::before { border-style: dashed; }
.rail .nav-out, .strip .nav-out { font-style: italic; }

/* The talk list ends on a rule; give what follows room to breathe. */
.after-list { margin-top: 2.25rem; }
