/* =========================================================
   index3 — hero name, Find All, light/dark, second section
   Loaded after style.css, so this file can override it.
   ========================================================= */

:root {
  --accent: #ebff17;
  --accent-rgb: 235, 255, 23;
  --accent-ink: #0a0a0a;
  --hero-tracking: -0.035em;
}

html {
  background: var(--ink);
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

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

/* ---------- No pointer light, no custom cursor ---------- */

.cursor,
.portrait--light {
  display: none !important;
}

body.has-cursor,
body.has-cursor a,
body.has-cursor button {
  cursor: auto;
}

/* ---------- The first screen becomes a scrollable section ---------- */

.masthead {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.masthead .stage {
  position: absolute;
  inset: 0;
}

.portrait {
  transform: scale(1.04);
  will-change: auto;
}

.masthead .frame {
  position: absolute;
}

.masthead .side-label {
  position: absolute;
}

.topbar {
  position: absolute;
}

.masthead .content {
  position: absolute;
  inset: 0;
}

.masthead .footer {
  position: absolute;
}

/* ---------- Wider editorial column ---------- */

.content {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
}

.aside {
  width: 100%;
  max-width: 380px;
}

/* ---------- Expertise statement ---------- */

.statement {
  max-width: 34ch;
  margin: 22px 0 0;
  color: rgba(241, 235, 224, 0.9);
  font-size: clamp(1.02rem, 1.15vw, 1.22rem);
  line-height: 1.62;
  letter-spacing: -0.012em;
  cursor: pointer;
}

/* Hidden until the script has split it, so the sentence never flashes */
.js [data-find] {
  visibility: hidden;
}

.js [data-find].is-ready {
  visibility: visible;
}

/* ---------- 10 Find All (after Codrops) ---------- */

[data-effect="find-all"] .char {
  opacity: 0;
  transition:
    background-color 0.45s ease-out,
    color 0.45s ease-out;
}

[data-effect="find-all"] .char.is-match {
  color: var(--accent-ink);
  background-color: var(--accent);
  transition: none;
}

[data-effect="find-all"] .word {
  display: inline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Official LinkedIn button ---------- */

.linkedin {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 7px 18px 7px 7px;
  border: 1px solid rgba(241, 235, 224, 0.24);
  border-radius: 999px;
  color: var(--paper);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.linkedin__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #0a66c2;
  color: #fff;
}

.linkedin__icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.linkedin__arrow {
  font-size: 15px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.35s var(--ease);
}

.linkedin:hover,
.linkedin:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.linkedin:hover .linkedin__arrow,
.linkedin:focus-visible .linkedin__arrow {
  transform: translate(2px, -2px);
}

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

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.theme-toggle__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  display: block;
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- Hero name (after the Codrops hero) ---------- */

.hero {
  opacity: 0;
  font-size: 12vw;
  line-height: 0.82;
  letter-spacing: var(--hero-tracking);
  white-space: nowrap;
}

.hero.is-fitted {
  opacity: 1;
}

.hero__word {
  display: inline-flex;
  align-items: baseline;
  overflow: clip;
  padding: 0.16em 0.06em 0.02em;
  margin: -0.16em -0.06em -0.02em;
}

.hero__letter {
  display: inline-block;
  white-space: pre;
  will-change: transform;
}

.hero__letter--last {
  color: transparent;
  font-style: italic;
  -webkit-text-stroke: clamp(1.2px, 0.16vw, 2.6px) var(--paper);
}

.hero__letter--dot {
  color: var(--accent);
  font-style: normal;
  -webkit-text-stroke: 0;
}

.hero__ending {
  display: inline-grid;
}

.hero__ending > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: baseline;
}

.hero__probe {
  position: absolute;
  visibility: hidden;
  font-size: 100px;
  letter-spacing: var(--hero-tracking);
  white-space: nowrap;
}

.hero__probe em {
  font-style: italic;
}

/* If the script never runs, show the name and the text anyway */
.is-fallback .hero {
  opacity: 1;
}

.is-fallback .hero__letter {
  transform: none !important;
}

.is-fallback [data-effect="find-all"] .char {
  opacity: 1 !important;
}

/* ---------- Scroll cue ---------- */

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.3s ease;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  color: var(--paper);
}

.scroll-cue:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.scroll-cue__line {
  width: 28px;
  height: 1px;
  background: var(--line);
}

.scroll-cue__arrow {
  color: var(--accent);
  animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---------- Second section ---------- */

.work {
  position: relative;
  z-index: 5;
  padding: clamp(64px, 10vh, 120px) var(--pad) clamp(34px, 5vh, 60px);
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.work__inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.work__head {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 30px);
}

.work__title {
  max-width: 18ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 7.5rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.92;
}

.work__title em {
  color: transparent;
  font-style: italic;
  -webkit-text-stroke: clamp(1px, 0.12vw, 2px) var(--paper);
}

.work__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
  margin-top: clamp(40px, 6vh, 80px);
}

.work__figure {
  max-width: 520px;
  margin: 0;
}

.work__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  object-fit: cover;
  filter: grayscale(1) contrast(1.04) brightness(0.94);
}

.work__figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.work__body {
  max-width: 46ch;
}

.work__lead {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.14;
}

.work__body p + p {
  margin-top: 20px;
}

.work__body > p:not(.work__lead) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.005em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tags li:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.linkedin--work {
  margin-top: 34px;
}

.work__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(50px, 8vh, 100px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.work__footer p {
  margin: 0;
}

.work__top {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.work__top:hover,
.work__top:focus-visible {
  color: var(--paper);
}

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

/* ---------- Light theme ---------- */

html[data-theme="light"] {
  --ink: #f2efe6;
  --paper: #0b0b0b;
  --muted: rgba(11, 11, 11, 0.6);
  --line: rgba(11, 11, 11, 0.18);
  /* On cream the accent goes dark: the dot, the name and the highlights */
  --accent: #40431c;
  --accent-ink: #f2efe6;
}

html[data-theme="light"] body {
  background: var(--ink);
  color: var(--paper);
}

html[data-theme="light"] .masthead {
  background: var(--ink);
}

html[data-theme="light"] .stage {
  background: #e6e1d4;
}

html[data-theme="light"] .portrait {
  filter: grayscale(1) contrast(1.03) brightness(1.08);
}

html[data-theme="light"] .shade {
  background:
    linear-gradient(180deg, rgba(242, 239, 230, 0.6) 0%, rgba(242, 239, 230, 0) 22%),
    linear-gradient(90deg, rgba(242, 239, 230, 0) 0%, rgba(242, 239, 230, 0.06) 24%, rgba(242, 239, 230, 0.8) 55%, rgba(242, 239, 230, 0.97) 78%, #f2efe6 100%),
    linear-gradient(0deg, #f2efe6 0%, rgba(242, 239, 230, 0.94) 20%, rgba(242, 239, 230, 0.42) 48%, rgba(242, 239, 230, 0) 70%),
    radial-gradient(120% 100% at 30% 40%, transparent 40%, rgba(242, 239, 230, 0.3) 100%);
}

html[data-theme="light"] .grain {
  opacity: 0.035;
  mix-blend-mode: multiply;
}

html[data-theme="light"] .frame {
  border-color: rgba(11, 11, 11, 0.14);
}

html[data-theme="light"] .statement {
  color: rgba(11, 11, 11, 0.88);
}

html[data-theme="light"] .eyebrow__dot {
  box-shadow: 0 0 0 1px rgba(11, 11, 11, 0.35);
  animation-name: pulse-dark;
}

/* The same pulse, in the dark accent of the light theme */
@keyframes pulse-dark {
  0% { box-shadow: 0 0 0 0 rgba(64, 67, 28, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(64, 67, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(64, 67, 28, 0); }
}

html[data-theme="light"] .hero__letter--dot {
  -webkit-text-stroke: 1px var(--paper);
}

html[data-theme="light"] .linkedin {
  border-color: rgba(11, 11, 11, 0.22);
  color: var(--paper);
}

html[data-theme="light"] .work {
  background: var(--ink);
  color: var(--paper);
}

html[data-theme="light"] .work__figure img {
  filter: grayscale(1) contrast(1.02) brightness(1.02);
}

html[data-theme="light"] .loader {
  background: var(--ink);
}

html[data-theme="light"] .scroll-cue__arrow {
  filter: drop-shadow(0 0 1px rgba(11, 11, 11, 0.45));
}

/* ---------- Accent pulse, in the new accent ---------- */

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(235, 255, 23, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(235, 255, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(235, 255, 23, 0); }
}

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

@media (max-width: 900px) {
  .masthead {
    min-height: 100svh;
  }

  .masthead .content {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100svh;
    padding: 100px var(--pad) 70px;
  }

  .aside {
    align-self: flex-start;
    justify-self: start;
    width: 100%;
    max-width: 360px;
    margin: 0 0 20px;
  }

  .statement {
    max-width: none;
    margin-top: 16px;
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .linkedin {
    margin-top: 22px;
    padding: 6px 16px 6px 6px;
  }

  .linkedin__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .linkedin__icon svg {
    width: 18px;
    height: 18px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .theme-toggle__label {
    display: none;
  }

  .topbar__meta {
    gap: 26px;
  }

  .topbar__meta p:last-child {
    display: none;
  }

  .side-label {
    display: none;
  }

  .work__grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .work__figure {
    max-width: 420px;
  }

  .work__title {
    max-width: 14ch;
  }

  .work__title em {
    -webkit-text-stroke-width: 1px;
  }

  .work__footer {
    margin-top: 56px;
  }
}

@media (max-width: 380px) {
  .statement {
    font-size: 0.93rem;
  }

  .work__lead {
    font-size: 1.45rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .statement {
    cursor: auto;
  }

  .hero {
    opacity: 1;
  }

  .hero__letter {
    transform: none !important;
  }

  .js [data-find],
  [data-effect="find-all"] .char {
    visibility: visible;
    opacity: 1;
  }

  .scroll-cue__arrow {
    animation: none;
  }
}
