/* Acid Grotesk */
@font-face {
  font-family: "Acid Grotesk";
  src: url("fonts/FFF-AcidGrotesk-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Acid Grotesk";
  src: url("fonts/FFF-AcidGrotesk-Medium.otf") format("opentype");
  font-weight: 500 600;
  font-display: swap;
}
@font-face {
  font-family: "Acid Grotesk";
  src: url("fonts/FFF-AcidGrotesk-ExtraBold.otf") format("opentype");
  font-weight: 700 800;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #696969;
  --text-strong: #535353;
  --text-muted: rgba(0, 0, 0, 0.5);

  /* How a project fades/scales in as it snaps into view */
  --reveal-duration: 700ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --scale-inactive: 0.92;

  --gutter: 40px;
  --header-h: 180px; /* updated from JS to the header's real height */
}

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

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Acid Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }

/* ---------- Layout: fixed header over one long, snapping list ---------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: linear-gradient(var(--bg) 82%, rgba(255, 255, 255, 0));
  padding-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-top: 36px;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.intro { max-width: 538px; }

.intro__name {
  font-size: 20px;
  font-weight: 400;
  line-height: normal;
}

.intro__bio {
  margin-top: 15px;
  font-size: 16px;
  line-height: 1.35;
}

.company {
  font-weight: 600; /* Acid Grotesk Medium */
  text-decoration: underline transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-color 250ms ease;
}
.company.is-active { text-decoration-color: currentColor; }


/* ---------- Project list ---------- */

.project {
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  /* Media row grows up to the phone's full height, then the leftover space is
     split above and below so the image + caption sit together in the middle. */
  grid-template-rows: minmax(0, 1fr) minmax(0, 565px) auto minmax(0, 1fr);
  justify-items: center;
  padding: calc(var(--header-h) + 8px) var(--gutter) 40px;
}

.project__media {
  grid-row: 2;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-end; /* sit right on top of the caption */
  justify-content: center;
}

.project > .caption {
  grid-row: 3;
  margin-top: 30px;
}

/* Only the project in view is shown; it fades and scales in as it snaps into place. */
.project__media,
.caption {
  opacity: 0;
  transform: scale(var(--scale-inactive));
  transition:
    transform var(--reveal-duration) var(--ease),
    opacity var(--reveal-duration) var(--ease);
}
.caption { transform: translateY(12px); }
.project.is-active .project__media,
.project.is-active .caption { opacity: 1; transform: none; }
.project.is-active .caption { transition-delay: 80ms; }

/* Closing line after the last project */
.outro {
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 8px) var(--gutter) 40px;
  text-align: center;
}
.outro__line {
  font-size: 20px; /* headline style, same as the name */
  font-weight: 400;
  line-height: normal;
  opacity: 0;
  transform: translateY(12px);
  transition:
    transform var(--reveal-duration) var(--ease),
    opacity var(--reveal-duration) var(--ease);
}
.outro.is-active .outro__line { opacity: 1; transform: none; }
.outro__line a { text-decoration: underline; text-decoration-color: rgba(0, 0, 0, 0.2); text-underline-offset: 4px; transition: text-decoration-color 200ms ease; }
.outro__line a:hover { text-decoration-color: currentColor; }

/* Phone: a screen composited into the iPhone frame, or a pre-rendered phone image. */
.phone {
  position: relative;
  height: min(100%, 565px);
  aspect-ratio: 275 / 565;
}
.phone__frame,
.phone__screen,
.phone__render {
  position: absolute;
  display: block;
  max-width: none;
}
.phone__frame { inset: 0; width: 100%; height: 100%; }
.phone__screen { top: 1.88%; left: 4.4%; width: 91.12%; height: 96.24%; object-fit: cover; border-radius: 13% / 6%; background: #fff; }
.phone__island {
  /* Matches the dynamic island in an iPhone 16 Pro screen recording, mapped into the screen area */
  position: absolute;
  top: 3.3%;
  left: 29.8%;
  width: 38.9%;
  height: 4.15%;
  border-radius: 999px;
  background: #000;
}
.phone__render { inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* Photo pair: both images share one height; each one's flex-grow is its aspect ratio. */
.photos {
  display: flex;
  gap: 16px;
  height: min(100%, 440px);
  aspect-ratio: 1.95;
  max-width: calc(100vw - 2 * var(--gutter));
}
.photos img {
  display: block;
  flex: var(--ratio) 1 0;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Missing-asset placeholder */
.placeholder {
  position: absolute;
  top: 1.88%; right: 4.48%; bottom: 1.88%; left: 4.4%;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 12%/6%;
  background: #f4f4f4;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Caption ---------- */

.caption {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
  line-height: normal;
}

.caption__title {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 600;
}
.caption__body {
  margin-top: 8px;
  color: var(--text-strong);
  font-size: 14px;
}
.caption__meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Chat cursor ---------- */

/* Figma-style chat cursor: an arrow with a quiet grey message bubble at its tail */
.chat-cursor {
  --chat-arrow: #a6a6a6;
  --chat-bg: #f2f2f2;
  --chat-fg: #6e6e6e;
  position: fixed;
  top: -2px;  /* arrow tip sits on the pointer */
  left: -2px;
  z-index: 10;
  pointer-events: none;
  translate: var(--x, -100px) var(--y, -100px);
  transform-origin: 2px 2px;
  scale: 0.6;
  opacity: 0;
  transition: opacity 180ms ease, scale 180ms ease;
}
.chat-cursor.is-visible { opacity: 1; scale: 1; }

.chat-cursor__arrow {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.15));
}
.chat-cursor__arrow path {
  fill: var(--chat-arrow);
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.chat-cursor__bubble {
  position: absolute;
  top: 17px;
  left: 15px;
  padding: 4px 9px 5px;
  border-radius: 3px 12px 12px 12px;
  background: var(--chat-bg);
  color: var(--chat-fg);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (hover: hover) and (pointer: fine) {
  .project[data-cursor="chat"] .project__media > * { cursor: none; }
}

/* ---------- Password gate ---------- */

.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.gate__form { width: 100%; max-width: 360px; }
.gate__name { font-size: 20px; }
.gate__label { display: block; margin-top: 15px; font-size: 16px; }
.gate__row { display: flex; gap: 8px; margin-top: 24px; }
.gate__input,
.gate__button {
  font: inherit;
  font-size: 14px;
  border-radius: 10px;
  height: 44px;
}
.gate__input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid #dcdcdc;
  color: var(--text-strong);
  background: #fff;
}
.gate__input:focus { outline: none; border-color: var(--text); }
.gate__button {
  padding: 0 18px;
  border: 0;
  background: var(--text-strong);
  color: #fff;
  cursor: pointer;
}
.gate__button:hover { background: #333; }
.gate__error { margin-top: 12px; font-size: 14px; color: #d0453a; }
.gate.is-shaking .gate__row { animation: shake 0.35s ease; }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .header { flex-direction: column; gap: 14px; padding-top: 20px; }
  .intro__bio { margin-top: 8px; font-size: 14px; }
  .intro__bio br { display: none; }
  .project, .outro { padding-top: calc(var(--header-h) + 32px); }
  .project { padding-bottom: 28px; }
  .project > .caption { margin-top: 26px; }
  .caption__body, .caption__meta { margin-top: 6px; }

  /* Photo pair stacks: same width, each image's share of the height follows its shape. */
  .photos {
    flex-direction: column;
    gap: 10px;
    height: 100%;
    width: auto;
    aspect-ratio: 0.44;
    max-width: 100%;
  }
  .photos img {
    flex: calc(1 / var(--ratio)) 1 0;
    width: 100%;
    height: auto;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --reveal-duration: 1ms; }
  html { scroll-behavior: auto; }
}
