:root {
  --bg: #fbfbf9;
  --ink: #141414;
  --muted: #8f8f8a;
  --font: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---- Brand (left) ---- */
.brand {
  position: fixed;
  left: clamp(20px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.brand__name { font-weight: 500; }
.brand__role { color: var(--muted); }

/* ---- Nav (right) ---- */
.nav {
  position: fixed;
  right: clamp(20px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 10;
}
.nav a {
  position: relative;
  transition: opacity .18s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .22s ease;
}
.nav a:hover::after,
.nav a.is-current::after { transform: scaleX(1); transform-origin: left; }
.nav a.is-current { font-weight: 500; }

/* ---- Mobile nav toggle (hidden on desktop) ---- */
.nav-toggle {
  display: none;
  position: fixed;
  top: 22px;
  right: 20px;
  z-index: 20;
  width: 24px;
  height: 18px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform .22s ease, opacity .22s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Center stage ---- */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 24px;
}

.view {
  display: none;
  width: 100%;
  max-width: 460px;
  animation: fade .45s ease both;
}
.view.is-active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Photo slideshow */
.view--index { max-width: none; display: none; }
.view--index.is-active { display: flex; justify-content: center; cursor: pointer; }
.slideshow {
  position: relative;
  height: 74vh;
  width: min(44vw, 480px);
}
.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.slideshow img.is-active { opacity: 1; }

/* Text views */
.view--text { line-height: 1.75; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { color: #3a3a37; }
.entries li + li { margin-top: 20px; }
.entries__lead { color: var(--ink); font-weight: 500; }
.entries a {
  color: var(--ink);
  border-bottom: 1px solid rgba(58, 58, 55, 0.35);
  transition: border-color .22s ease;
}
.entries a:hover { border-bottom-color: currentColor; }
.entries a.icon-link {
  border-bottom: 0;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 5px;
  color: var(--muted);
  transition: color .22s ease;
}
.entries a.icon-link:hover { color: var(--ink); }
.entries a.icon-link svg { width: 13px; height: 13px; display: block; }

/* Brand colours on hover — each logo lights up in its own official colour */
.entries a.icon-link path { transition: fill .22s ease; }
.entries a.icon-link[href*="youtube.com"]:hover,
.entries a.icon-link[href*="youtu.be"]:hover { color: #FF0000; }
.entries a.icon-link[href*="ycombinator.com"]:hover { color: #F0652F; }
.entries a.icon-link[href*="linkedin.com"]:hover { color: #0A66C2; }
.entries a.icon-link[href*="apps.apple.com"]:hover { color: #000000; }
.entries a.icon-link[href*="play.google.com"]:hover .gp-blue   { fill: #4285F4; }
.entries a.icon-link[href*="play.google.com"]:hover .gp-green  { fill: #34A853; }
.entries a.icon-link[href*="play.google.com"]:hover .gp-yellow { fill: #FBBC04; }
.entries a.icon-link[href*="play.google.com"]:hover .gp-red    { fill: #EA4335; }

/* Portfolio — two columns: project list (left) + preview panel (right) */
.view--portfolio { max-width: 960px; }
.portfolio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 6vw, 72px);
}
.portfolio__col { display: flex; flex-direction: column; flex: 0 1 360px; }
.portfolio .entries {
  display: none;
  margin: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
 .portfolio .entries.is-active { display: block; opacity: 1; transform: translateY(0); }

.pagination {
  display: flex;
  gap: 18px;
  margin-top: 32px;
  padding-bottom: 4px; /* Contain the page-link underline without creating a scrollbar. */
}
.pagination__link {
  position: relative;
  color: var(--muted);
  transition: color .18s ease;
}
.pagination__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .22s ease;
}
.pagination__link:hover { color: var(--ink); }
.pagination__link:hover::after { transform: scaleX(1); transform-origin: left; }
.pagination__link.is-current {
  color: var(--ink);
  font-weight: 500;
}
.pagination__link.is-current::after { transform: scaleX(1); }

.work-panel {
  flex: 0 0 auto;
  position: relative;
  width: min(500px, 46vw);
  margin: 0 30px 14px 0;
  padding: 10px 10px 16px;
  border-radius: 14px 14px 7px 7px;
  border: 1px solid #435165;
  background: linear-gradient(135deg, #263449, #111b29 65%, #263449);
  box-shadow: 0 14px 32px rgba(15, 25, 40, 0.16);
}
.work-panel::after {
  content: "";
  position: absolute;
  left: -6%;
  bottom: -10px;
  width: 112%;
  height: 12px;
  border: 1px solid #435165;
  border-radius: 2px 2px 12px 12px;
  background: linear-gradient(#435165, #263449 40%, #152031);
  box-shadow: 0 10px 16px rgba(15, 25, 40, 0.12);
}
.work-panel::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 40%;
  bottom: -4px;
  width: 20%;
  height: 4px;
  border-radius: 0 0 5px 5px;
  background: #101a28;
}
.work-panel__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 5px;
  background: #07090d;
}
.work-panel.is-portrait {
  height: min(480px, calc(100dvh - 220px));
  aspect-ratio: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.work-panel.is-portrait::before,
.work-panel.is-portrait::after { display: none; }
.work-panel.is-portrait .work-panel__screen {
  height: 100%;
  aspect-ratio: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}
.work-panel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  opacity: 0;
  transition: opacity .45s ease;
}
.work-panel__img.is-shown { opacity: 1; }
.work-panel.is-portrait .work-panel__img {
  left: 50%;
  right: auto;
  width: auto;
  max-width: 100%;
  transform: translateX(-50%);
  border: 4px solid #161b23;
  border-radius: 23px;
  outline: 1px solid #78818e;
  box-shadow: 0 12px 28px rgba(15, 25, 40, 0.16), 0 0 0 2px #273140;
}

/* Idle state — shown until a project is hovered */
.work-panel__idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  transition: opacity .3s ease;
}
.work-panel.is-visible .work-panel__idle { opacity: 0; }
.work-panel__caret {
  width: 9px;
  height: 16px;
  background: var(--muted);
  border-radius: 1px;
  animation: blink 1.15s steps(1) infinite;
}
.work-panel__hint { letter-spacing: 0.12em; }
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@media (max-width: 820px) {
  .view--portfolio { max-width: 460px; }
  .work-panel { display: none; }
}

/* Multi-platform entry — store/web action buttons, left-aligned above the text */
.entry--apps .app-links {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.entry--apps .app-links .icon-link { margin-left: 0; }
.entry--apps .app-links .icon-link svg { width: 15px; height: 15px; }

.info { margin: 0; color: #3a3a37; line-height: 1.85; }


.contact { list-style: none; margin: 28px 0 0; padding: 0; text-align: center; }
.contact li + li { margin-top: 20px; }
.contact a {
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
}
.contact a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .22s ease;
}
.contact a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  body { font-size: 12.5px; }

  .brand {
    position: fixed;
    top: 22px;
    left: 20px;
    transform: none;
    flex-direction: column;
    gap: 4px;
  }
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    top: 52px;
    right: 20px;
    transform: none;
    align-items: flex-end;
    gap: 14px;
    z-index: 15;
    background: var(--bg);
    border: 1px solid rgba(20, 20, 20, 0.08);
    border-radius: 4px;
    padding: 18px 20px;
    box-shadow: 0 12px 28px rgba(20, 20, 20, 0.1);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .stage { padding: 120px 22px 60px; align-items: center; }
  .view { max-width: 100%; }
  .view--index.is-active { cursor: pointer; }
  .slideshow { width: 80vw; height: 60vh; }
}

@media (max-width: 420px) {
  .nav { gap: 12px; }
  .nav a, .brand__name, .brand__role { font-size: 11px; }
}

/* ---- Project details ---- */
.details-link {
  display: inline-block;
  margin-left: 4px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.35);
  color: var(--ink);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.3;
  transition: border-color .22s ease;
}
.details-link:hover { border-bottom-color: currentColor; }

.view--project {
  max-width: 820px;
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  overflow-y: auto;   /* Full-length detail copy scrolls; summary sections stay page-sized. */
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.project__back {
  position: sticky;
  top: 0;
  display: block;
  padding-bottom: 18px;
  width: fit-content;
  background: var(--bg);
  font-weight: 500;
  letter-spacing: 0.14em;
  z-index: 1;
  transition: color .22s ease;
}
.project__back:hover { color: var(--muted); }
.project__back:focus-visible { outline-offset: -2px; }

/* Photo top-left, title / tagline / links beside it */
.project__head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.project__media {
  flex: 0 0 auto;
  display: block;
  width: min(300px, 38%);
  aspect-ratio: 19 / 10;
  object-fit: contain;
  object-position: top center;
  border-radius: 10px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  background: #f1f1ec;
}
.project__media--portrait { width: min(240px, 40%); aspect-ratio: auto; }
.project__media.project__media--portrait {
  border-color: #161b23;
  margin-left: 4px;
  margin-top: 4px;
  border-radius: 23px;
  outline: 1px solid #78818e;
  box-shadow: 0 0 0 3px #161b23, 0 12px 28px rgba(15, 25, 40, 0.12);
}
.project__screenshot { display: block; width: 100%; height: auto; margin-top: 24px; border-radius: 10px; }

/* Photography and book details preserve the full image beside readable copy. */
.project--editorial:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: auto 1fr;
  gap: 24px 32px;
  align-items: start;
}
.project--editorial .project__head { display: contents; }
.project--editorial .project__media {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.project--editorial .project__intro,
.project--editorial .project__body { grid-column: 2; }
.project--editorial .project__links { margin-top: 12px; }
.project--editorial .project__body { margin: 0; padding: 0; border: 0; }

@media (max-width: 720px) {
  .project--editorial:not([hidden]) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .project--editorial .project__media {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    max-width: 100%;
    max-height: 340px;
    justify-self: start;
  }
  .project--editorial .project__intro,
  .project--editorial .project__body { grid-column: 1; }
  .project--editorial .project__intro { grid-row: 1; }
  .project--editorial .project__body { grid-row: 3; }
}
/* Work entries show the company logo on a tile instead of a screenshot */
.project__logo {
  flex: 0 0 auto;
  display: block;
  width: 88px;
  height: 88px;
  padding: 18px;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  background: #ffffff;
}
.project__logo--bleed { padding: 0; object-fit: cover; }
.project__intro { min-width: 0; }
.project__title { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0.06em; }
.project__tagline { margin: 4px 0 12px; color: var(--muted); }


.project__body {
  max-width: 680px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(20, 20, 20, 0.08);
  color: #3a3a37;
}
.project__body p { margin: 0; }
.project__body p + p,
.project__body .entries + p { margin-top: 18px; }
.project__body .entries { margin: 0; }

.project__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.project__links a {
  color: var(--ink);
  border-bottom: 1px solid rgba(58, 58, 55, 0.35);
  transition: border-color .22s ease;
}
.project__links a:hover { border-bottom-color: currentColor; }

@media (max-width: 720px) {
  .project__head { gap: 14px; }
  .project__media { width: 42%; border-radius: 6px; }
  .project__logo { width: 64px; height: 64px; padding: 13px; border-radius: 15px; }
  .project__logo--bleed { padding: 0; }
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/jetbrains-mono-400.ttf") format("truetype");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-500.ttf") format("truetype");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-700.ttf") format("truetype");
}

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

.view--text {
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.view--index:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 8px;
}

.portfolio .entries { transition: none; }

@media (max-width: 720px) {
  .view--index:focus-visible { outline-offset: -4px; }
  .nav:not(.is-open) {
    visibility: hidden;
  }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .view { animation: none; }
}
