/* Homepage styles. Phase 1: layout and content, no animation. */

/* ---------------------------------------------------------------- Base */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100svh;
  overflow-x: clip;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: var(--track-heading); line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--pill); color: var(--pill-text); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 8px 12px; border-radius: var(--r);
  background: var(--pill); color: var(--pill-text); font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* The theme change cross-fades, only while it is happening. */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color var(--d-micro) linear, border-color var(--d-micro) linear, color var(--d-micro) linear, fill var(--d-micro) linear !important;
}

/* Placeholders: clearly labelled until the real asset arrives. */
.placeholder {
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px dashed var(--title-ghost);
  border-radius: var(--r);
  color: var(--text-muted);
  text-align: center;
}
.placeholder span { max-width: 28ch; }

/* ---------------------------------------------------------------- Small parts */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: var(--r);
  background: var(--chip);
  color: var(--text);
  font-weight: 300;
  white-space: nowrap;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--icon-btn);
  height: var(--icon-btn);
  border: var(--hairline);
  border-radius: var(--r);
  color: var(--text);
  transition: background-color var(--d-micro) var(--ease), border-color var(--d-micro) var(--ease);
}
.icon-btn:hover { background: var(--chip); }
.icon-btn svg { width: 14px; height: 14px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--icon-btn);
  padding: 0 10px;
  border-radius: var(--r);
  background: var(--pill);
  color: var(--pill-text);
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--d-micro) var(--ease);
}
.pill:hover { opacity: 0.86; }
.pill svg { width: 12px; height: 12px; }
.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: var(--hairline);
  border-radius: var(--r);
  font-weight: 600;
  transition: background-color var(--d-micro) var(--ease);
}
.btn-line:hover { background: var(--chip); }
.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--d-micro) var(--ease);
}
.text-link:hover { text-decoration-color: currentColor; }
.muted { color: var(--text-muted); }

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

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Solid once the visitor scrolls past the first screen (see nav.js). */
.nav.is-solid {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--border);
}
.nav__brand { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.nav__links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  font-weight: 600;
}
.nav__links a { padding: 6px 0; transition: color var(--d-micro) var(--ease); }
.nav__links a:hover { color: var(--text-muted); }
.nav__actions { display: flex; align-items: center; gap: 6px; }
.nav__divider { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.nav__menu-btn { display: none; }

/* Theme toggle: shows the moon in light, the sun in dark */
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* Full-screen menu (mobile) */
.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) 32px;
  background: var(--bg);
}
.menu[hidden] { display: none; }
.menu__top { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; }
.menu__links { display: grid; gap: 8px; margin-top: 48px; }
.menu__links a { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--track-heading); }
.menu__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

@media (max-width: 767px) {
  .nav__links,
  .nav__actions { display: none; }
  .nav__menu-btn { display: inline-grid; }
}

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

.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
}
.hero__media {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(240px, 23.6vw);       /* 340 @1440 */
  aspect-ratio: 340 / 450;
  transform: translate(-50%, -50%);
}
.hero__media.placeholder { position: absolute; }
/* The orb. --orb-size is the sphere itself; the canvas is 1.6x wider so
   the glow can fade out. */
.hero__orb {
  --orb-size: clamp(200px, 18vw, 300px);   /* 260 @1440 */
  width: calc(var(--orb-size) * 1.6);
  max-width: 100%;
  aspect-ratio: 1;
}
.hero__orb canvas { display: block; width: 100%; height: 100%; }
.hero__text {
  position: absolute;
  left: var(--gutter);
  bottom: var(--gutter);
}
.hero__title {
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: var(--track-display);
}
.hero__intro {
  margin-top: 12px;
  font-size: var(--fs-intro);
  line-height: 1.3;
  max-width: 32ch;
}

@media (max-width: 767px) {
  .hero {
    height: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  }
  .hero__media { position: relative; left: auto; top: auto; transform: none; width: 70vw; margin-inline: auto; }
  .hero__media.placeholder { position: relative; }
  .hero__orb { --orb-size: 200px; width: calc(var(--orb-size) * 1.6); }
  .hero__text { position: static; }
}

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

.section-title {
  margin: var(--section-above) var(--gutter) var(--section-below);
  text-align: center;
  font-size: var(--fs-section);
  line-height: 1.1;
  color: var(--title-ghost);
}
section { scroll-margin-top: 0; }

/* Featured Work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px var(--gap);
  padding: 0 var(--gutter);
}
.card { display: block; }
.card__media {
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
}
.card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: 14px;
}
.card__tags { display: flex; flex-wrap: wrap; align-content: start; gap: 4px; }
.card__title { font-size: var(--fs-card); line-height: 1.1; }
.card__desc { margin-top: 6px; max-width: 46ch; }
@media (max-width: 767px) {
  .work-grid { grid-template-columns: 1fr; gap: 48px; }
  .card__meta { grid-template-columns: 1fr; gap: 10px; }
  .card__tags { order: 2; }
}

/* Apps: pocket cards */
.apps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px 32px;
  padding: 80px var(--gutter) 0;
}
.pocket {
  position: relative;
  display: block;
  flex: none;
  width: 290px;
  height: 360px;
  border-radius: var(--r-pocket);
  background: var(--surface);
  border: var(--hairline);
  box-shadow: var(--shadow-soft);
}
.pocket__card {
  z-index: 0;
  will-change: transform;
  position: absolute;
  inset: 12px 12px auto;
  height: 300px;
  border-radius: var(--r-pocket-inner);
  background: var(--surface);
  border: var(--hairline);
  overflow: hidden;
}
.pocket__band {
  position: relative;
  height: 130px;
  background: linear-gradient(160deg, var(--app-a), var(--app-b));
}
.pocket__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.pocket__icon--dark { background: #1c1c1c; color: #ffffff; transform: translate(-82%, -50%) rotate(-6deg); }
.pocket__icon--light { background: #ffffff; color: #1c1c1c; transform: translate(-18%, -46%) rotate(6deg); }
.pocket__body { padding: 16px 16px 0; }
.pocket__title { font-size: var(--fs-card); line-height: 1.1; }
.pocket__desc { margin-top: 8px; color: var(--text); }
/* The front lip: frosted, so what sits behind it reads blurred. */
.pocket__lip {
  z-index: 1;
  position: absolute;
  inset: auto 0 0;
  height: 142px;
  border-radius: 0 0 var(--r-pocket) var(--r-pocket);
  border-top: var(--hairline);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pocket__action {
  z-index: 2;
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: var(--hairline);
  background: var(--surface);
}
.pocket__action svg { width: 14px; height: 14px; }
.pocket__status {
  z-index: 2;
  position: absolute;
  right: 16px;
  bottom: 20px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pill-text);
  font-weight: 600;
}
.pocket:focus-visible { border-radius: var(--r-pocket); outline-offset: 4px; }
.card:focus-visible { outline-offset: 6px; }
.pocket__action svg { transform-origin: 50% 50%; }
/* Without GSAP (a blocked CDN) the lift still happens, in CSS. */
html:not(.gsap) .pocket__card { transition: transform var(--d-lift) var(--ease); }
html:not(.gsap) .pocket__action svg { transition: transform var(--d-hover) var(--ease); }
html:not(.gsap) .pocket.is-open .pocket__card { transform: translateY(-70px); }
html:not(.gsap) .pocket.is-open .pocket__action svg { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  html:not(.gsap) .pocket__card,
  html:not(.gsap) .pocket__action svg { transition: none; }
}

@media (max-width: 767px) {
  .apps {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 24px;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .apps::-webkit-scrollbar { display: none; }
  .pocket { scroll-snap-align: start; width: min(290px, 80vw); }
}

/* Approach */
.approach {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  padding: 0 var(--gutter);
}
.habit { padding-top: 14px; border-top: var(--hairline); }
.habit__no { color: var(--text-muted); }
.habit__title { margin-top: 32px; font-size: var(--fs-card); }
.habit__body { margin-top: 10px; max-width: 40ch; }
@media (max-width: 767px) {
  .approach { grid-template-columns: 1fr; gap: 40px; }
}

/* Kind Words */
.words {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px var(--gap);
  padding: 0 var(--gutter);
}
.word { display: flex; flex-direction: column; gap: 24px; }
.word__quote { font-size: var(--fs-intro); line-height: 1.35; max-width: 40ch; }
.word__quote p { text-indent: -0.4em; }
.word__who { display: grid; grid-template-columns: 40px auto 1fr; gap: 0 12px; align-items: center; margin-top: auto; }
.word__who img { width: 40px; height: 40px; border-radius: 50%; grid-row: span 2; }
.word__name { font-weight: 600; }
.word__role { grid-column: 2 / span 2; color: var(--text-muted); }
/* LinkedIn logo, right after the name */
.word__in { grid-row: 1; grid-column: 3; justify-self: start; display: inline-flex; margin-left: -4px; border-radius: 3px; transition: opacity var(--d-micro) linear; }
.word__in svg { width: 16px; height: 16px; display: block; }
.word__in:hover { opacity: 0.8; }
@media (max-width: 767px) {
  .words {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 82vw;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    padding-bottom: 16px;
  }
  .word { scroll-snap-align: start; }
}

/* CTA */
.cta {
  padding: 200px var(--gutter) 160px;
  text-align: center;
}
.cta__title {
  font-size: var(--fs-cta);
  line-height: 1.02;
  letter-spacing: var(--track-display);
}
.cta__line { display: block; }
.cta__arrow {
  display: inline-block;
  width: 0.9em;
  height: 0.72em;     /* about cap height */
  vertical-align: baseline;
  margin-right: 0.12em;
}
.cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.cta__note { margin-top: 24px; color: var(--text-muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: var(--r);
  background: var(--pill);
  color: var(--pill-text);
  font-weight: 600;
}
.toast[hidden] { display: none; }

/* Footer */
.footer {
  position: relative;
  padding: 120px var(--gutter) var(--gutter);
  text-align: center;
  border-top: var(--hairline);
}
.footer__lines { display: grid; gap: 2px; }
.footer__lines li:first-child { font-weight: 600; }
.footer__logos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 48px;
}
.footer__logo {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px dashed var(--title-ghost);
  border-radius: var(--r);
  color: var(--text-muted);
  font-weight: 600;
}
.footer__clock { margin-top: 32px; font-variant-numeric: tabular-nums; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 96px;
  text-align: left;
}
.footer__links { display: flex; gap: 16px; }
@media (max-width: 767px) {
  .footer__bottom { flex-direction: column-reverse; align-items: center; text-align: center; }
}

/* ---------------------------------------------------------------- Motion */

/* Intro states, only while the intro is about to run (see the <head> script). */
.motion .nav > *,
.motion .hero__title,
.motion .hero__intro,
.motion .hero__media { opacity: 0; }

/* Cursor label */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: var(--r);
  background: var(--pill);
  color: var(--pill-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  will-change: transform;
}
.cursor::after { content: " \203A"; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor { display: none; }
}

/* SplitText masks keep descenders */
.habit [data-reveal-lines] > div { padding-bottom: 0.08em; margin-bottom: -0.08em; }

