/* Phyzzicist — phyzzicist.dev
   Phone first. Wider layouts at 700px and 1000px.
   Motion uses the same curve as the Ametrine site: cubic-bezier(.22, 1, .36, 1). */

:root {
  --black: #000000;
  --raised: #0b0b0b;
  --raised-2: #121211;
  --white: #f4f4f1;
  --grey: #a3a39e;
  --dim: #6c6c67;
  --line: #222221;
  --line-strong: #353533;
  --phi: #6d5bff;
  --live: #5fd48a;

  --display: "Sora", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  --gutter: 20px;
  --max: 1200px;
  --section: 96px;
  --header: 64px;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
}

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

html {
  overflow-x: clip;
  color-scheme: dark;
  background: var(--black);
  color: var(--white);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 24px);
}

body {
  margin: 0;
  background: var(--black);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  overflow-x: clip;
}
body.is-locked { overflow: hidden; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* Italic words in headings, as on the old site. Sora has no italic,
   so a true italic from IBM Plex Sans is used. */
h1 em,
h2 em {
  font-family: var(--body);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.035em;
}

p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button { font: inherit; color: inherit; }

svg path,
svg line { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

::selection { background: var(--white); color: var(--black); }

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

main:focus { outline: none; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 16px;
  background: var(--white);
  color: var(--black);
  font-weight: 500;
  border-radius: 8px;
  z-index: 60;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 10px); }

/* Shared edges */

.header-inner,
.hero-inner,
.stats,
.services,
.work,
.process,
.about,
.faq,
.contact,
.page-hero-inner,
.sub-section,
.site-footer {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Brand mark */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  text-decoration: none;
}

.brand-mark { width: 26px; height: 26px; flex: none; color: var(--white); }
.brand-mark path,
.brand-mark line { stroke-width: 10; }

.brand-word {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.035em;
  line-height: 1;
  padding-bottom: 2px;
}

.phi-line { stroke: var(--phi) !important; }

/* Header: hides as you scroll down, comes back as you scroll up */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, 0);
  border-bottom: 1px solid transparent;
  transition: transform .5s var(--ease), background-color .3s var(--ease), border-color .3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(0, 0, 0, .82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.site-header.is-hidden { transform: translateY(-100%); }

.header-inner {
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-desktop { display: none; }
.nav-desktop ul { display: flex; align-items: center; gap: 2px; }

.nav-desktop a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--grey);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav-desktop a[data-nav]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 9px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav-desktop a:hover,
.nav-desktop a.is-current { color: var(--white); }
.nav-desktop a[data-nav]:hover::after,
.nav-desktop a.is-current::after { transform: scaleX(1); transform-origin: left; }

.nav-desktop .nav-contact {
  margin-left: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--white);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.nav-desktop .nav-contact:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.menu-open {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-right: -4px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--raised);
  cursor: pointer;
  transition: border-color .2s var(--ease);
}
.menu-open:hover { border-color: var(--grey); }
.menu-open-lines { display: grid; gap: 6px; width: 18px; }
.menu-open-lines span {
  display: block;
  height: 1.5px;
  border-radius: 2px;
  background: var(--white);
  transition: transform .4s var(--ease);
}
.menu-open-lines span:last-child { width: 12px; justify-self: end; }
.menu-open:hover .menu-open-lines span:last-child { transform: scaleX(1.5); transform-origin: right; }

/* Menu panel (phones) */

.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: hidden;
}
.menu[open] { display: flex; justify-content: flex-end; }
.menu::backdrop {
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.menu.is-open::backdrop { opacity: 1; }

.menu-panel {
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--black);
  border-left: 1px solid var(--line);
  transform: translateX(104%);
  transition: transform .5s var(--ease);
}
.menu.is-open .menu-panel { transform: none; }

.menu-top {
  height: var(--header);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 20px;
}

.menu-close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--raised);
  cursor: pointer;
  transition: transform .4s var(--ease), border-color .2s var(--ease);
}
.menu-close svg { width: 18px; height: 18px; }
.menu-close svg path { stroke-width: 1.6; }
.menu-close:hover { transform: rotate(90deg); border-color: var(--grey); }

.menu-links { padding: 16px 20px 0; display: grid; }

.menu-links li,
.menu-foot {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .4s var(--ease), transform .6s var(--ease);
}
.menu.is-open .menu-links li,
.menu.is-open .menu-foot {
  opacity: 1;
  transform: none;
  transition-delay: calc(.12s + var(--i) * .05s);
}

.menu-links a {
  display: grid;
  gap: 2px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.menu-links a span {
  font-family: var(--display);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
  transition: transform .45s var(--ease);
}
.menu-links a small { color: var(--grey); font-size: 0.875rem; }
.menu-links a:hover span { transform: translateX(6px); }

.menu-foot {
  margin-top: auto;
  padding: 24px 20px 28px;
  display: grid;
  gap: 14px;
  justify-items: start;
}
.menu-email { color: var(--grey); font-size: 0.9375rem; }

/* Badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(11, 11, 11, .7);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}

/* Hero */

.hero {
  position: relative;
  overflow: clip;
  padding-top: calc(var(--header) + env(safe-area-inset-top, 0px) + 28px);
  isolation: isolate;
}

.field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 35%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 70% 35%, #000 30%, transparent 78%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

/* On phones the badge sits beside the mark, everything else runs full width */
.hero-text { display: contents; }

.hero-text .badge { grid-column: 1; grid-row: 1; justify-self: start; align-self: end; margin-bottom: 6px; }
.hero-mark { grid-column: 2; grid-row: 1; }
.kicker,
.hero-title,
.lede,
.actions,
.socials { grid-column: 1 / -1; }

.kicker { margin-top: 36px; color: var(--grey); font-size: 0.9375rem; }

.hero-title {
  margin-top: 10px;
  font-size: clamp(2.6rem, 12.4vw, 5.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0 .12em .1em 0;
  margin-bottom: -.1em;
}
.hero-title .line > span { display: block; }

.lede {
  margin-top: 22px;
  max-width: 30em;
  color: var(--grey);
  font-size: 1.0625rem;
}

.actions {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--white);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.button svg { width: 18px; height: 18px; flex: none; transition: transform .45s var(--ease); }
.button svg path { stroke-width: 1.7; }
.button:hover { border-color: var(--grey); }
.button:hover svg { transform: translateX(3px); }
.button:active { transform: scale(.97); }

.button-primary { background: var(--white); border-color: var(--white); color: var(--black); }
.button-primary:hover { background: #ffffff; border-color: #ffffff; }

.socials {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--grey);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .35s var(--ease);
}
.socials a:hover { color: var(--white); border-color: var(--grey); transform: translateY(-2px); }
.socials svg { width: 19px; height: 19px; }
.socials svg path { stroke-width: 1.7; }

/* The mark */

.hero-mark { position: relative; }

.mark-glow {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 244, 241, .08), transparent 70%);
  pointer-events: none;
}

.pendulum {
  position: relative;
  display: block;
  width: 92px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pendulum:active { cursor: grabbing; }
.pendulum svg { display: block; width: 100%; height: auto; overflow: visible; }
.pendulum path,
.pendulum line { stroke-width: 8; }

/* Stats */

.stats {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 18px 10px 22px 0;
  border-top: 1px solid var(--line);
}
.stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.stats dt { color: var(--grey); font-size: 0.8125rem; line-height: 1.35; }
.stats dd {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Skills ticker: always moving, speeds up when you scroll */

.ticker {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.no-js .ticker-track { animation: ticker 50s linear infinite; }
.ticker li {
  display: flex;
  align-items: center;
  padding: 20px 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--grey);
  white-space: nowrap;
}
.ticker li::after {
  content: "";
  width: 5px;
  height: 5px;
  margin: 0 26px;
  border-radius: 50%;
  border: 1px solid var(--dim);
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* Sections */

.services,
.work,
.process,
.about,
.faq,
.contact { padding-top: var(--section); }

.section-head { display: grid; gap: 14px; }

.section-head h2,
.contact h2 {
  font-size: clamp(2.125rem, 8vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.section-lede { max-width: 34em; color: var(--grey); font-size: 1.0625rem; }

/* About and skills */

.skills { margin-top: 36px; display: grid; gap: 12px; }

.skill {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--raised);
  transition: border-color .3s var(--ease), transform .45s var(--ease), background-color .3s var(--ease);
}
.skill:hover { border-color: var(--line-strong); background: var(--raised-2); }

.skill h3 { font-size: 1.0625rem; letter-spacing: -0.02em; }

.skill ul { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.skill li {
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--grey);
  font-size: 0.875rem;
  line-height: 1.4;
}

.skill-learning { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.skill-learning li { border-style: dashed; }

/* Work */

.projects { margin-top: 36px; display: grid; gap: 12px; }

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--raised);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.project:hover { border-color: var(--line-strong); background: var(--raised-2); }

.project-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.project-type { color: var(--grey); font-size: 0.875rem; }
.project-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--grey);
  font-size: 0.8125rem;
}
.project-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

.project h3 {
  margin-top: 6px;
  font-size: clamp(1.5rem, 5.6vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.project-desc { max-width: 36em; color: #d6d6d1; }

.project-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.project-stack li {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--grey);
  font-size: 0.8125rem;
}

.project-link {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 500;
}
/* Whole card is the link target */
.project-link::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project-link svg { width: 20px; height: 20px; flex: none; transition: transform .45s var(--ease); }
.project-link svg path { stroke-width: 1.6; }
.project:hover .project-link svg { transform: translate(3px, -3px); }

/* Contact */

.contact { padding-bottom: var(--section); }

.contact-card {
  position: relative;
  overflow: hidden;
  padding: 36px 22px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(244, 244, 241, .06), transparent 60%),
    var(--raised);
}

.contact-lede {
  margin-top: 16px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.contact-body { margin-top: 8px; max-width: 34em; color: var(--grey); font-size: 1.0625rem; }

.email-list {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.email-row {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.email {
  display: inline-block;
  max-width: 100%;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 5.4vw, 2.75rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}
.email span {
  background-image: linear-gradient(var(--white), var(--white));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .6s var(--ease);
}
.email:hover span { background-size: 100% 2px; }

.email-row .copy { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }

.copy svg { width: 18px; height: 18px; }
.copy .check-icon { display: none; }
.copy.is-copied { border-color: var(--live); }
.copy.is-copied .copy-icon { display: none; }
.copy.is-copied .check-icon { display: block; color: var(--live); animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* Services: one bordered grid with shared dividing lines */

.service-grid {
  margin-top: 36px;
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--line);
  overflow: hidden;
}

.service {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 26px 22px 28px;
  background: var(--black);
  transition: background-color .35s var(--ease);
}
.service:hover { background: var(--raised); }

.service-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  color: var(--grey);
  transition: color .3s var(--ease), transform .5s var(--ease);
}
.service-icon path,
.service-icon rect { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.service:hover .service-icon { color: var(--white); transform: translateY(-3px) rotate(-4deg); }

.service h3 { font-size: 1.25rem; letter-spacing: -0.025em; }
.service p { color: var(--grey); max-width: 30em; }

/* How I work: stacking cards. Each step sticks near the top of the screen
   and the next one slides over it; the ones underneath shrink back and dim. */

.steps {
  margin: 40px 0 0;
  padding: 0 0 16vh; /* lets the finished stack hold for a moment */
  list-style: none;
  display: grid;
  gap: 18px;
}

.step {
  position: sticky;
  top: calc(var(--header) + 20px + var(--i) * 14px);
}

.step-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "top  icon"
    "body body";
  gap: 26px 16px;
  min-height: 260px;
  padding: 24px 22px 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-l);
  background: #0d0d0c;
  box-shadow: 0 -18px 40px -24px rgba(0, 0, 0, .9);
  transform-origin: 50% 0;
  transform: scale(var(--s, 1));
  will-change: transform;
}
.step-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: #000;
  opacity: var(--dim, 0);
  pointer-events: none;
}

.step-top { grid-area: top; display: flex; align-items: center; gap: 14px; }

.step-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

.step-count { color: var(--grey); font-size: 0.875rem; }

.step-icon {
  grid-area: icon;
  width: 40px;
  height: 40px;
  color: var(--grey);
}
.step-icon path,
.step-icon rect,
.step-icon circle { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.step-body { grid-area: body; align-self: end; }
.step h3 { font-size: clamp(1.75rem, 7vw, 3rem); line-height: 1.05; letter-spacing: -0.04em; }
.step p { margin-top: 10px; color: var(--grey); max-width: 32em; font-size: 1.0625rem; }

/* FAQ */

.faq-list { margin-top: 32px; border-top: 1px solid var(--line); }

.faq-item { border-bottom: 1px solid var(--line); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
  transition: color .2s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: #ffffff; }

.faq-icon {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform .5s var(--ease), border-color .2s var(--ease), background-color .3s var(--ease);
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--white);
  transform: translate(-50%, -50%);
  transition: transform .5s var(--ease), background-color .3s var(--ease);
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item summary:hover .faq-icon { border-color: var(--grey); }
.faq-item[open] .faq-icon { transform: rotate(180deg); background: var(--white); border-color: var(--white); }
.faq-item[open] .faq-icon::before { background: var(--black); }
.faq-item[open] .faq-icon::after { background: var(--black); transform: translate(-50%, -50%) rotate(0deg); }

.faq-body { overflow: hidden; }
.faq-body p { padding: 0 52px 22px 0; color: var(--grey); max-width: 38em; }

.section-lede a { color: var(--white); text-decoration-color: var(--dim); transition: text-decoration-color .2s var(--ease); }
.section-lede a:hover { text-decoration-color: var(--white); }

/* Skill pages */

.page-hero { padding-top: calc(var(--header) + env(safe-area-inset-top, 0px) + 40px); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 0.9375rem;
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--grey);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.crumbs a:hover { color: var(--white); }
.crumbs [aria-current] { color: var(--white); }

.page-title { margin-top: 18px; font-size: clamp(2.6rem, 13vw, 6.5rem); }
.page-title .line { display: inline-block; vertical-align: top; }

.page-hero .lede { margin-top: 24px; max-width: 34em; }

.chips { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--grey);
  font-size: 0.875rem;
  line-height: 1.4;
}
.chips-dashed li { border-style: dashed; }

.sub-section { padding-top: var(--section); }
.page-hero + .sub-section { padding-top: calc(var(--section) * .8); }

.tool-list { margin-top: 32px; border-top: 1px solid var(--line); }

.tool-row {
  display: grid;
  gap: 6px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.tool-row h3 {
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  transition: transform .5s var(--ease);
}
.tool-row p { color: var(--grey); max-width: 38em; }
.tool-row:hover h3 { transform: translateX(6px); }

.principles { margin-top: 32px; display: grid; gap: 12px; }

.principle {
  padding: 24px 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--raised);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.principle:hover { border-color: var(--line-strong); background: var(--raised-2); }
.principle h3 { font-size: 1.125rem; letter-spacing: -0.02em; }
.principle p { margin-top: 8px; color: var(--grey); }

.learning-card {
  padding: 30px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-l);
}
.learning-tag { color: var(--grey); font-size: 0.875rem; }
.learning-card h2 { margin-top: 8px; font-size: clamp(1.75rem, 6vw, 2.5rem); letter-spacing: -0.035em; }
.learning-card > p:not(.learning-tag) { margin-top: 10px; color: var(--grey); max-width: 38em; }
.learning-card .chips { margin-top: 20px; }

.pager { display: grid; gap: 12px; }

.pager-link {
  display: grid;
  gap: 6px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  text-decoration: none;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.pager-link:hover { border-color: var(--line-strong); background: var(--raised); }
.pager-dir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--grey);
  font-size: 0.875rem;
}
.pager-dir svg { width: 16px; height: 16px; transition: transform .45s var(--ease); }
.pager-dir svg path { stroke-width: 1.7; }
.pager-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.pager-prev:hover .pager-dir svg { transform: translateX(-4px); }
.pager-next:hover .pager-dir svg { transform: translateX(4px); }

.sub-cta { padding-bottom: var(--section); }
.cta-card {
  padding: 36px 22px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(244, 244, 241, .06), transparent 60%),
    var(--raised);
}
.cta-card h2 { font-size: clamp(1.875rem, 7vw, 3rem); line-height: 1.06; letter-spacing: -0.04em; }
.cta-card > p { margin-top: 12px; color: var(--grey); font-size: 1.0625rem; max-width: 34em; }
.cta-card .actions { margin-top: 26px; }

/* Home page: skill cards link to their own page */
.skill { position: relative; }
.skill-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.skill-link::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.skill-link svg { width: 16px; height: 16px; transition: transform .45s var(--ease); }
.skill-link svg path { stroke-width: 1.7; }
.skill:hover .skill-link svg { transform: translateX(4px); }

/* Statement: an Apple-style pinned moment. The section is tall, its inner
   part sticks to the screen, and the words light up as you scroll through. */

.statement {
  position: relative;
  height: 230vh;
  margin-top: var(--section);
}

.statement-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.statement-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(120vw, 900px);
  height: auto;
  color: var(--white);
  opacity: .06;
  transform: translate(-50%, -50%) scale(var(--mark-scale, .86)) rotate(var(--mark-turn, 0deg));
  will-change: transform;
  pointer-events: none;
}
.statement-mark path,
.statement-mark line { stroke-width: 3; }
.statement-mark .phi-line { stroke: var(--white) !important; }

.statement-text {
  position: relative;
  max-width: 17em;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 7.6vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-align: center;
  text-wrap: balance;
}

.statement-text .word {
  opacity: var(--o, .16);
  transition: opacity .25s linear;
}

/* Contact form */

.contact-alt { margin-top: 30px; color: var(--grey); font-size: 0.9375rem; }
.contact-alt + .email-list { margin-top: 10px; }
.contact-intro .email { font-size: clamp(1.1rem, 5.2vw, 1.6rem); }
/* In the narrow intro column, the Copy button always sits under the address */
.contact-intro .email-row { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; justify-items: start; }

.contact-form-wrap { margin-top: 36px; position: relative; }

.contact-form { display: grid; gap: 20px; }
.contact-form[hidden] { display: none; }

.field-row { display: grid; gap: 20px; }

.form-field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }

.form-field label,
.form-field legend {
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--white);
}
.optional { color: var(--dim); font-weight: 400; }

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-size: 1rem; /* 16px stops iPhones zooming in on focus */
  transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .3s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.form-field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--dim); }
.form-field input:hover,
.form-field textarea:hover,
.form-field select:hover { border-color: var(--grey); }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--white);
  box-shadow: 0 0 0 4px rgba(244, 244, 241, .08);
}
.form-field.is-invalid input,
.form-field.is-invalid textarea { border-color: #e5484d; }

.field-error {
  min-height: 0;
  color: #ff8b8b;
  font-size: 0.875rem;
}
.field-error:empty { display: none; }

.select { position: relative; }
.select svg {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--grey);
  pointer-events: none;
}
.select svg path { stroke-width: 1.7; }
.select select { padding-right: 44px; cursor: pointer; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--grey);
  font-size: 0.9375rem;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.choice:hover span { border-color: var(--grey); color: var(--white); }
.choice input:checked + span { background: var(--white); border-color: var(--white); color: var(--black); }
.choice input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 3px; }
.choice:active span { transform: scale(.96); }
.form-field.is-invalid .choice span { border-color: #e5484d; }

.form-foot { display: grid; gap: 14px; margin-top: 4px; }
.form-note { color: var(--dim); font-size: 0.875rem; }

.form-submit { width: 100%; }
.form-submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, .2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.form-submit.is-sending { pointer-events: none; opacity: .85; }
.form-submit.is-sending .spinner { display: block; }
.form-submit.is-sending svg { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status { color: #ff8b8b; font-size: 0.9375rem; }
.form-status:empty { display: none; }
.form-status a { color: var(--white); }

.form-success {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 32px 0 8px;
}
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success h3 { font-size: clamp(1.75rem, 6vw, 2.5rem); letter-spacing: -0.04em; }
.form-success p { color: var(--grey); max-width: 30em; }
.form-success .button { margin-top: 12px; }

.success-tick { width: 56px; height: 56px; color: var(--live); }
.success-tick circle,
.success-tick path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
  .form-success:not([hidden]) { animation: rise .7s var(--ease) both; }
  .form-success:not([hidden]) .success-tick circle { stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .7s var(--ease-in-out) .1s forwards; }
  .form-success:not([hidden]) .success-tick path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s var(--ease) .6s forwards; }
  .form-status:not(:empty) { animation: rise .5s var(--ease) both; }
}

/* Footer */

.site-footer {
  padding-top: 26px;
  padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 24px;
  color: var(--dim);
  font-size: 0.875rem;
}
.site-footer ul { display: flex; gap: 4px 20px; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--grey);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.site-footer a:hover { color: var(--white); }

/* Back to top */

.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(11, 11, 11, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s, border-color .2s var(--ease);
}
.to-top.is-visible:not(.is-tucked) { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--grey); }
.to-top svg { width: 18px; height: 18px; transition: transform .45s var(--ease); }
.to-top svg path { stroke-width: 1.7; }
.to-top:hover svg { transform: translateY(-3px); }

/* Entrance and scroll animations
   Only when JavaScript is running and the visitor hasn't asked for less motion. */

@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { animation: rise .9s var(--ease) var(--d, 0s) both; }
  .js .hero-title .line > span { animation: line-up 1.05s var(--ease) var(--d, 0s) both; }

  .js .site-header { animation: fade 1s var(--ease) .1s both; }

  .js .mark-glow { animation: glow-in 1.6s var(--ease) .35s both; }
  .js .pendulum .arc { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.1s var(--ease-in-out) .25s forwards; }
  .js .pendulum .arc-r { animation-delay: .35s; }
  .js .pendulum .phi-line { animation: drop 1s var(--ease) .75s both; }

  .js .field { animation: fade 2s var(--ease) .5s both; }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .9s var(--ease), transform 1s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  .js .ticker { animation: fade 1.2s var(--ease) .9s both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes line-up { from { transform: translateY(108%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes glow-in { from { opacity: 0; transform: scale(.7); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-26px); } }

/* Tablet and up */

@media (min-width: 700px) {
  :root {
    --gutter: 40px;
    --section: 128px;
    --header: 76px;
  }

  body { font-size: 1.0625rem; }

  .nav-desktop { display: block; }
  .menu-open { display: none; }

  .pendulum { width: 136px; }

  .actions { display: flex; flex-wrap: wrap; }
  .actions .button { min-width: 168px; }

  .stats div { padding: 22px 24px 26px 0; }
  .stats div + div { padding-left: 28px; }
  .stats dd { font-size: 2.5rem; }
  .stats dt { font-size: 0.875rem; }

  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-learning { grid-column: 1 / -1; }

  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service { padding: 34px 32px 36px; }

  .faq-item summary { font-size: 1.1875rem; min-height: 76px; }

  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-foot { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; }
  .form-submit { width: auto; min-width: 200px; }

  .tool-row { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px; align-items: baseline; padding: 28px 0; }
  .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .principle { padding: 30px 28px 32px; }
  .learning-card { padding: 44px 40px; }
  .pager { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .pager-link { padding: 32px 30px; }
  .pager-next { text-align: right; justify-items: end; }
  .cta-card { padding: 56px 48px 48px; }

  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .project { padding: 30px 30px 26px; }

  .contact-card { padding: 56px 48px 48px; }
  .email-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
  }
  .email-row .copy { min-width: 112px; }

  .menu { display: none !important; }
}

/* Desktop */

@media (min-width: 1000px) {
  :root {
    --gutter: 56px;
    --section: 160px;
  }

  .hero { padding-top: calc(var(--header) + 96px); }

  .hero-inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    column-gap: 56px;
    align-items: center;
  }

  .hero-text { display: block; }
  .hero-text .badge { margin-bottom: 0; }
  .hero-mark { grid-column: 2; grid-row: 1; justify-self: center; }

  .kicker { margin-top: 30px; }
  .lede { font-size: 1.1875rem; margin-top: 26px; }
  .actions { margin-top: 34px; }
  .socials { margin-top: 18px; }

  .pendulum { width: min(300px, 24vw); }
  .pendulum path,
  .pendulum line { stroke-width: 6.5; }

  .stats { margin-top: 96px; }

  .about {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 64px;
    align-items: start;
  }
  .about .section-head { position: sticky; top: calc(var(--header) + 32px); }
  .about .skills { margin-top: 0; }

  .work .section-head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 64px;
    align-items: end;
  }

  .project { padding: 36px 36px 30px; min-height: 380px; }

  .services .section-head,
  .process .section-head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 64px;
    align-items: end;
  }
  .service { padding: 40px 40px 44px; min-height: 260px; }

  .steps { margin-top: 56px; gap: 24px; }
  .step-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    grid-template-areas: "top body icon";
    align-items: start;
    min-height: 300px;
    padding: 40px 44px;
  }
  .step-body { align-self: end; }
  .step-icon { width: 48px; height: 48px; }

  .faq {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 64px;
    align-items: start;
  }
  .faq .section-head { position: sticky; top: calc(var(--header) + 32px); }
  .faq-list { margin-top: 0; }

  .page-hero { padding-top: calc(var(--header) + 96px); }

  .contact-card {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 72px;
    align-items: start;
  }
  .contact-form-wrap { margin-top: 6px; }
  .contact-intro .email { font-size: clamp(1.1rem, 1.85vw, 1.6rem); }
  .tool-row h3 { font-size: 1.625rem; }
  .cta-card { padding: 72px 64px 60px; }

  .contact-card { padding: 80px 72px 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .pendulum { cursor: default; }
  .field { display: none; }
  .step { position: static; }
  .steps { padding-bottom: 0; }
  .step-card { transform: none !important; }
  .step-card::after { display: none; }
  .statement { height: auto; padding: var(--section) 0 0; margin-top: 0; }
  .statement-sticky { position: static; height: auto; }
  .statement-text .word { opacity: 1 !important; }
  .ticker { -webkit-mask-image: none; mask-image: none; }
  .ticker-track { flex-wrap: wrap; width: auto; padding: 6px max(var(--gutter), env(safe-area-inset-left, 0px)); transform: none !important; }
  .ticker-track li[aria-hidden="true"] { display: none; }
  .ticker li { padding: 8px 0; }
}

/* 404 */

.not-found {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: calc(var(--header) + 72px) max(var(--gutter), env(safe-area-inset-right, 0px)) 96px max(var(--gutter), env(safe-area-inset-left, 0px));
  min-height: 80vh;
}
.not-found h1 { font-size: clamp(2.4rem, 10vw, 4.5rem); line-height: 1.02; letter-spacing: -0.045em; max-width: 11em; }
.not-found p { margin-top: 20px; color: var(--grey); max-width: 34em; }
.not-found .actions { display: flex; margin-top: 32px; }
