/* ============================================================
   thyda — portrait-led editorial profile
   Palette: cool neutral base + a single crimson accent lifted
   from the microphone indicator in the photograph.
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  color-scheme: dark light;

  /* dark is the designed default */
  --bg:          #101114;
  --bg-alt:      #15161a;
  --surface:     #17181c;
  --text:        #edece8;
  --text-dim:    #a3a29d;
  --text-faint:  #6f6f6d;
  --accent:      #e05c57;
  --accent-soft: rgba(224, 92, 87, 0.14);
  --hairline:    rgba(237, 236, 232, 0.13);
  --hairline-2:  rgba(237, 236, 232, 0.24);
  --on-accent:   #14151a;
  --shadow:      0 24px 60px -28px rgba(0, 0, 0, 0.85);

  --radius: 0px;
  --gutter: clamp(20px, 5vw, 56px);
  --max: 1240px;
  --nav-h: 68px;

  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg:          #ecedee;
    --bg-alt:      #f4f4f5;
    --surface:     #f7f7f8;
    --text:        #14151a;
    --text-dim:    #5b5e63;
    --text-faint:  #86888c;
    --accent:      #b2352f;
    --accent-soft: rgba(178, 53, 47, 0.10);
    --hairline:    rgba(20, 21, 26, 0.14);
    --hairline-2:  rgba(20, 21, 26, 0.28);
    --on-accent:   #ffffff;
    --shadow:      0 24px 60px -30px rgba(20, 21, 26, 0.28);
  }
}

:root[data-theme='light'] {
  --bg:          #ecedee;
  --bg-alt:      #f4f4f5;
  --surface:     #f7f7f8;
  --text:        #14151a;
  --text-dim:    #5b5e63;
  --text-faint:  #86888c;
  --accent:      #b2352f;
  --accent-soft: rgba(178, 53, 47, 0.10);
  --hairline:    rgba(20, 21, 26, 0.14);
  --hairline-2:  rgba(20, 21, 26, 0.28);
  --on-accent:   #ffffff;
  --shadow:      0 24px 60px -30px rgba(20, 21, 26, 0.28);
}

/* ---------- 2. Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 18px;
  font: 500 0.875rem/1 var(--sans);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* film grain, fixed so it never repaints on scroll */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 3. Layout primitives ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main > section { position: relative; }

.eyebrow {
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

.dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
  vertical-align: middle;
  margin-right: 0.55em;
}
.dot--accent { background: var(--accent); }

/* ---------- 4. Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 46px;
  padding: 0 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 500 0.9375rem/1 var(--sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--solid {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--solid:hover { background: var(--text); color: var(--bg); }

.btn--ghost {
  border-color: var(--hairline-2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--text); background: var(--accent-soft); }

/* ---------- 5. Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--hairline);
}

.nav__inner {
  height: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.wordmark {
  font: 500 1.0625rem/1 var(--sans);
  letter-spacing: -0.045em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.15em;
  margin-right: auto;
}
.wordmark__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-3px);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.9rem);
  font-size: 0.9375rem;
  color: var(--text-dim);
}
.nav__links a { position: relative; padding-block: 4px; transition: color 0.2s var(--ease); }
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__aside { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--hairline-2); }
.theme-toggle svg { width: 17px; height: 17px; overflow: visible; }
.theme-toggle__moon { display: none; }
.theme-toggle__sun  { fill: currentColor; stroke: none; }
.theme-toggle__rays { stroke: currentColor; }
:root[data-theme='light'] .theme-toggle__sun,
:root[data-theme='light'] .theme-toggle__rays { display: none; }
:root[data-theme='light'] .theme-toggle__moon { display: block; fill: currentColor; }

.nav__cta { height: 38px; padding: 0 1.05rem; font-size: 0.875rem; }

/* ---------- 6. Hero ---------- */

.hero {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(40px, 7vh, 84px) var(--gutter) clamp(56px, 9vh, 104px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4.25rem, 15vw, 9.5rem);
  line-height: 0.84;
  letter-spacing: -0.04em;
  margin: 0.28em 0 0.24em;
  text-wrap: balance;
}

.hero__lede {
  max-width: 38ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-dim);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

.hero__media { margin: 0; }

.frame {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.frame--portrait { aspect-ratio: 4 / 5; }

.frame__inner {
  position: absolute;
  inset: 0;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.05);
  transform-origin: 50% 45%;
}

.caption {
  margin-top: 0.85rem;
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.04fr 0.96fr;
  }
  .hero__media { margin-right: calc(-1 * var(--gutter)); }
}

/* ---------- 7. Statement ---------- */

.statement {
  background: var(--bg-alt);
  border-block: 1px solid var(--hairline);
  padding: clamp(64px, 11vh, 128px) var(--gutter);
}
.statement__inner {
  max-width: var(--max);
  margin-inline: auto;
}

.statement__text {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  max-width: 22ch;
  text-wrap: balance;
}
.statement__sub {
  display: block;
  margin-top: 0.9em;
  font-family: var(--sans);
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--text-dim);
  max-width: 46ch;
}

.statement__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.25rem;
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- 8. Section heads ---------- */

.section-head {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.section-note {
  max-width: 52ch;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.65;
}

/* ---------- 9. Bento ---------- */

.speaking, .writing { padding: clamp(64px, 11vh, 128px) 0; }

.bento {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.cell {
  background: var(--bg);
  padding: clamp(1.5rem, 2.6vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 100%;
}
.cell--feature { grid-column: span 4; grid-row: span 2; padding: 0; gap: 0; }
.cell:not(.cell--feature) { grid-column: span 2; }

.cell__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}
.cell__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 52% 16%;
  filter: grayscale(1) contrast(1.06) brightness(0.92);
  transition: filter 0.6s var(--ease), transform 0.9s var(--ease);
}
.cell--feature:hover .cell__media img {
  filter: grayscale(0.25) contrast(1.02) brightness(1);
  transform: scale(1.02);
}

.cell__body {
  padding: clamp(1.5rem, 2.6vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.cell__meta {
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.cell__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cell__text {
  color: var(--text-dim);
  font-size: 0.9688rem;
  line-height: 1.65;
  max-width: 46ch;
}

.cell__link {
  margin-top: auto;
  padding-top: 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  border-top: 1px solid var(--hairline);
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}
.cell__link::after { content: '\2192'; color: var(--text-faint); transition: transform 0.25s var(--ease); }
.cell:hover .cell__link::after { transform: translateX(4px); color: var(--accent); }

.cell--accent {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
}
.cell--accent .cell__title { font-size: clamp(1.3rem, 2.1vw, 1.7rem); }
.cell__link--action { color: var(--accent); }
.cell__link--action::after { color: var(--accent); }

@media (max-width: 899px) {
  .bento { grid-template-columns: 1fr; }
  .cell, .cell--feature { grid-column: 1 / -1; grid-row: auto; }
  .cell--feature { display: block; }
}

/* ---------- 10. Notes ---------- */

.notes {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  border-top: 1px solid var(--hairline);
}

.notes__row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 1.5rem;
  gap: 1.5rem;
  align-items: start;
  padding: clamp(1.4rem, 2.4vw, 2rem) 0;
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.3s var(--ease);
}
.notes__row:hover { background: var(--bg-alt); }

.notes__date {
  font: 500 0.75rem/1.6 var(--mono);
  letter-spacing: 0.12em;
  color: var(--text-faint);
  padding-top: 0.35em;
}

.notes__body { display: flex; flex-direction: column; gap: 0.4rem; }

.notes__title {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: color 0.25s var(--ease);
}
.notes__row:hover .notes__title { color: var(--accent); }

.notes__text {
  color: var(--text-dim);
  font-size: 0.9688rem;
  line-height: 1.6;
  max-width: 60ch;
}

.notes__arrow {
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1.6;
  text-align: right;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.notes__row:hover .notes__arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

@media (max-width: 640px) {
  .notes__row { grid-template-columns: 1fr; gap: 0.5rem; }
  .notes__arrow { display: none; }
  .notes__date { padding-top: 0; }
}

/* ---------- 11. Contact ---------- */

.contact {
  background: var(--bg-alt);
  border-top: 1px solid var(--hairline);
  padding: clamp(72px, 13vh, 150px) var(--gutter);
}
.contact__inner {
  max-width: var(--max);
  margin-inline: auto;
}

.contact__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 6.2vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 16ch;
  text-wrap: balance;
}

.contact__text {
  margin-top: 1.25rem;
  max-width: 46ch;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.6;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.email-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  font: 500 0.9375rem/1 var(--mono);
  letter-spacing: -0.01em;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.email-copy:hover { color: var(--text); }
.email-copy__state {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.email-copy.is-copied .email-copy__state { opacity: 1; }

/* ---------- 12. Footer ---------- */

.foot {
  padding: clamp(2rem, 4vw, 3rem) var(--gutter);
  border-top: 1px solid var(--hairline);
}
.foot__inner {
  max-width: var(--max);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.foot__mark {
  font: 500 1rem/1 var(--sans);
  letter-spacing: -0.045em;
}
.foot__meta {
  font: 500 0.75rem/1.6 var(--mono);
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.foot__meta a { border-bottom: 1px solid var(--hairline-2); transition: color 0.2s var(--ease); }
.foot__meta a:hover { color: var(--accent); }

/* ---------- 13. Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .hero__eyebrow { animation: rise 0.9s var(--ease) 0.05s both; }
  .js .hero__title   { animation: rise 0.9s var(--ease) 0.12s both; }
  .js .hero__lede    { animation: rise 0.9s var(--ease) 0.22s both; }
  .js .hero__actions { animation: rise 0.9s var(--ease) 0.3s both; }
  .js .hero__media   { animation: fade 1.1s var(--ease) 0.1s both; }

  .js .frame img { animation: fade 1.2s var(--ease) 0.15s both; }

  .js .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
    transition-delay: var(--d, 0s);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes settle {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}

/* slow parallax drift on the portrait, driven by scroll position */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .frame--portrait .frame__inner {
      animation: drift linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 90vh;
    }
    @keyframes drift {
      from { transform: translateY(-1.6%); }
      to   { transform: translateY(1.6%); }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
