/* Fonts */

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* Tokens: black and white only. Dark is the default for everyone. */

:root {
  --paper: #000000;
  --ink: #FFFFFF;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --bar: 60px;
  --pad: clamp(20px, 5vw, 48px);
  color-scheme: dark;
}

:root:has(#theme:checked) {
  --paper: #FFFFFF;
  --ink: #000000;
  color-scheme: light;
}

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

/* Base */

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

html {
  background: var(--paper);
  color: var(--ink);
  scroll-padding-top: calc(var(--bar) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  timeline-scope: --about, --work, --ventures, --education, --contact;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.006em;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

p,
h1,
h2,
h3,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

p {
  text-wrap: pretty;
}

h1,
h2 {
  text-wrap: balance;
}

a {
  color: inherit;
}

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

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

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

/* Skip link */

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
}

.skip:focus {
  top: 12px;
}

/* Links */

.link,
.org[href] {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 1px;
}

.link:hover,
.link:focus-visible,
.org[href]:hover,
.org[href]:focus-visible {
  background-size: 100% 2px;
}

.org[href]::after {
  content: "↗" / "";
  display: inline-block;
  margin-left: 0.2em;
  font-weight: 400;
  font-size: 0.85em;
}

.arrow {
  display: inline-block;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--paper);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--bar);
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}

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

.nav a {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--paper);
}

.nav a:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Theme toggle: closed eye in dark mode, open eye in light mode */

.eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
}

.eye-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.eye-open,
.to-dark,
.theme-input:checked ~ .topbar .eye-closed,
.theme-input:checked ~ .topbar .to-light {
  display: none;
}

.theme-input:checked ~ .topbar .eye-open {
  display: block;
}

.theme-input:checked ~ .topbar .to-dark {
  display: inline;
}

.theme-input:focus-visible ~ .topbar .eye {
  outline: 2px solid var(--ink);
  outline-offset: 0;
}

/* Hero */

.hero {
  display: grid;
  gap: 48px;
  align-items: end;
  padding-top: clamp(64px, 12vw, 144px);
  padding-bottom: clamp(64px, 10vw, 120px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  transform: scale(0);
}

h1 {
  margin-top: 24px;
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.tagline {
  max-width: 34em;
  margin-top: 14px;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.4;
}


.lead {
  --lh: 1.08em;
  --bleed-top: 0.04em;
  --bleed-bottom: 0.24em;
  margin-top: 40px;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 500;
  line-height: var(--lh);
  letter-spacing: -0.035em;
}

/* The sentence breaks after "make"; the rotating word shares the second line */
.lead-line {
  display: block;
}

/* Rotating audience word: a one-line window over a vertical strip of words.
   The window extends below the line so descenders are not clipped, with a
   matching negative margin so line spacing is unchanged. Words leave through
   the top edge of the line, so nothing crosses the line above. */

.rotator {
  position: relative;
  display: inline-block;
  vertical-align: top;
  height: calc(var(--lh) + var(--bleed-top) + var(--bleed-bottom));
  margin-top: calc(-1 * var(--bleed-top));
  margin-bottom: calc(-1 * var(--bleed-bottom));
  padding-right: 0.1em;
  overflow: hidden;
  font-weight: 600;
}

.rotator-strip {
  display: block;
}

.rotator-strip > span {
  display: block;
  height: calc(var(--lh) + var(--bleed-top) + var(--bleed-bottom));
  padding-top: var(--bleed-top);
  line-height: var(--lh);
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
}

.btn-line {
  background: var(--paper);
  color: var(--ink);
}

.btn-line:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.portrait {
  display: block;
  width: min(100%, 280px);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  filter: grayscale(1) contrast(1.05);
}

/* Blocks */

.block {
  position: relative;
  display: grid;
  gap: 20px 48px;
  padding-top: 28px;
  padding-bottom: clamp(72px, 9vw, 112px);
}

.block::before,
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--pad);
  right: var(--pad);
  height: 1px;
  background: var(--ink);
  transform-origin: 0 50%;
}

.block-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.block-body {
  min-width: 0;
  max-width: 680px;
}

.prose p + p {
  margin-top: 1.1em;
}

.prose p:first-child {
  font-size: 1.25rem;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

/* Entries */

.entry + .entry {
  margin-top: 40px;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 6px;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.org {
  font-weight: 600;
}

.role {
  display: inline-block;
  margin-left: 0.35em;
  font-style: italic;
}

.date {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.source {
  margin-top: 10px;
  font-size: 0.9375rem;
  font-style: italic;
}

/* Contact */

.contact-intro {
  font-size: 1.25rem;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.big-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  margin-top: 12px;
  font-size: clamp(1.625rem, 4.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
  padding-bottom: 4px;
  overflow-wrap: anywhere;
}

#contact {
  min-height: 78svh;
}

.contact-rows {
  margin-top: 40px;
  border-top: 1px solid var(--ink);
}

.row {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink);
}

.row dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0;
}

.row dd {
  min-width: 0;
}

/* Footer */

.footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 40px;
  font-size: 0.875rem;
}

/* Wide screens: section titles float beside their content */

@media (min-width: 960px) {
  .hero:has(.portrait) {
    grid-template-columns: 1fr auto;
  }

  .block {
    grid-template-columns: 240px 1fr;
  }

  .block-head {
    position: sticky;
    top: calc(var(--bar) + 28px);
    align-self: start;
    flex-direction: column;
    gap: 6px;
  }
}

/* Medium and small screens */

@media (max-width: 859.98px) {
  .wordmark {
    display: none;
  }

  .topbar-inner {
    gap: 12px;
  }

  .nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: -8px;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav ul {
    padding: 4px 0;
  }

  .nav a {
    padding: 5px 9px;
  }

  .eye-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 599.98px) {
  body {
    font-size: 1rem;
  }


  .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .entry-head {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .prose p:first-child,
  .contact-intro {
    font-size: 1.125rem;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 359.98px) {
  .lead {
    font-size: 1.5rem;
  }

  /* The smallest phones: locations take their own line inside the badge */
  .status {
    flex-wrap: wrap;
    row-gap: 2px;
    border-radius: 12px;
  }

  .status-sep {
    display: none;
  }

  .status-place {
    flex-basis: 100%;
    padding-left: 17px;
  }
}

/* Motion. Skipped entirely for people who prefer reduced motion. */

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

  html,
  body,
  .topbar,
  .nav a,
  .status,
  .eye,
  .dot,
  .row,
  .contact-rows {
    transition:
      background-color 0.35s var(--ease),
      color 0.35s var(--ease),
      border-color 0.35s var(--ease),
      box-shadow 0.2s var(--ease);
  }

  .link,
  .org[href],
  .big-link {
    transition: background-size 0.25s var(--ease);
  }

  .arrow,
  .org[href]::after {
    transition: transform 0.25s var(--ease);
  }

  .btn {
    transition:
      transform 0.2s var(--ease),
      box-shadow 0.2s var(--ease),
      background-color 0.35s var(--ease),
      color 0.35s var(--ease),
      border-color 0.35s var(--ease);
  }

  .btn:hover {
    transform: translateY(-2px);
  }

  .btn:active {
    transform: translateY(0) scale(0.98);
  }

  .btn-solid:hover .arrow,
  .big-link:hover .arrow {
    transform: translateX(4px);
  }

  .btn-line:hover .arrow,
  .nav-ext:hover .arrow,
  .org[href]:hover::after {
    transform: translate(2px, -2px);
  }

  .big-link:hover {
    background-size: 100% 3px;
  }

  /* The hero enters in a gentle stagger */
  .hero-text > *,
  .portrait {
    animation: rise 0.9s var(--ease) both;
  }

  .hero-text > :nth-child(2) { animation-delay: 0.08s; }
  .hero-text > :nth-child(3) { animation-delay: 0.16s; }
  .hero-text > :nth-child(4) { animation-delay: 0.26s; }
  .hero-text > :nth-child(5) { animation-delay: 0.36s; }
  .portrait { animation-delay: 0.3s; }

  /* Audience word: 2.2s hold, 0.4s eased move, four words, 10.4s loop */
  .rotator-strip {
    animation: rotate-words 10.4s ease-in-out infinite;
  }

  /* A slow ring around the status dot */
  .dot::after {
    animation: pulse 2.4s var(--ease) infinite;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes rotate-words {
  0%, 21.154% { transform: translateY(0); }
  25%, 46.154% { transform: translateY(-20%); }
  50%, 71.154% { transform: translateY(-40%); }
  75%, 96.154% { transform: translateY(-60%); }
  100% { transform: translateY(-80%); }
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(0.6); }
  80%, 100% { opacity: 0; transform: scale(1.6); }
}

/* Scroll-driven: progress line, active section in the bar, reveals.
   Browsers without support show everything in place. */

@supports (animation-timeline: view()) {
  #about { view-timeline: --about block; }
  .work-group { view-timeline: --work block; }
  #ventures { view-timeline: --ventures block; }
  #education { view-timeline: --education block; }
  #contact { view-timeline: --contact block; }

  #about,
  .work-group,
  #ventures,
  #education,
  #contact {
    view-timeline-inset: 30% 69%;
  }

  .nav-about { animation: nav-on linear; animation-timeline: --about; }
  .nav-work { animation: nav-on linear; animation-timeline: --work; }
  .nav-ventures { animation: nav-on linear; animation-timeline: --ventures; }
  .nav-education { animation: nav-on linear; animation-timeline: --education; }
  .nav-contact { animation: nav-on linear; animation-timeline: --contact; }

  .progress {
    animation: grow linear both;
    animation-timeline: scroll(root);
  }

  .topbar {
    animation: edge linear both;
    animation-timeline: scroll(root);
    animation-range: 0 120px;
  }

  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    .block::before {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes nav-on {
  from, to {
    background: var(--ink);
    color: var(--paper);
    box-shadow: inset 0 0 0 1px var(--ink);
  }
}

@keyframes grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes edge {
  from { border-bottom-color: var(--paper); }
  to { border-bottom-color: var(--ink); }
}

@keyframes draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .dot::after {
    display: none;
  }
}

/* Print */

@media print {
  :root,
  :root:has(#theme:checked) {
    --paper: #FFFFFF !important;
    --ink: #000000 !important;
    color-scheme: light;
  }

  @page {
    margin: 18mm;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  body {
    font-size: 10.5pt;
  }

  .topbar,
  .skip,
  .actions,
  .status,
  .portrait,
  .footer p:last-child {
    display: none;
  }

  .wrap {
    max-width: none;
    padding-inline: 0;
  }

  .block::before,
  .footer::before {
    left: 0;
    right: 0;
  }

  .hero {
    display: block;
    padding: 0 0 18pt;
  }

  h1 {
    margin-top: 0;
    font-size: 28pt;
  }

  .lead {
    margin-top: 12pt;
    max-width: none;
    font-size: 16pt;
  }

  .block {
    grid-template-columns: 110px 1fr;
    padding-top: 12pt;
    padding-bottom: 18pt;
  }

  .block-head {
    position: static;
    flex-direction: column;
    gap: 2pt;
  }

  h2 {
    font-size: 13pt;
  }

  .entry {
    break-inside: avoid;
  }

  .entry + .entry {
    margin-top: 12pt;
  }

  .big-link {
    font-size: 16pt;
  }

  .org[href]::after {
    content: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    font-weight: 400;
    font-style: normal;
    word-break: break-all;
  }

  .footer {
    padding-bottom: 0;
  }
}

/* 404 */

.page-simple {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 22px;
}

.page-simple h1 {
  margin-top: 0;
}

.page-simple p {
  margin-top: 24px;
  font-size: 1.25rem;
}
