/* ============================================================
   sections.css
   Per-section styling. Hero is complete here; the remaining
   sections have their structural scaffolding, refined in later
   build steps.
   ============================================================ */

/* ========================================================
   HERO
   ======================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50vw;  /* ~45% text · 55% image */
  align-items: stretch;
  overflow: hidden;
}

/* ---- Left content column ----
   No inner wrapper needed: padding-left aligns the text to the site
   container on wide screens, and as the viewport grows that same padding
   absorbs the extra width — so the text column stays a stable, readable
   size instead of stretching toward the image. */
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--space-9) + 44px) var(--space-9);
  padding-left: max(var(--gutter), calc((100vw - var(--container)) / 2));
  padding-right: clamp(var(--space-6), 4vw, var(--space-9));
}

/* Identity line above the name */
.hero__kicker { margin-bottom: var(--space-5); }

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.8rem, 7vw, 6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.hero__title .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-ocean);
}
/* SplitType wraps lines; we clip and lift them on reveal */
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > * { display: block; }

.hero__lead {
  margin-top: var(--space-5);
  font-size: var(--step-1);
  color: var(--color-muted);
  line-height: var(--leading-body);
  max-width: 42ch;
}

.hero__actions {
  margin-top: var(--space-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ---- Full-bleed portrait — no card, no frame, no shadow ----
   The image is a grid cell that stretches to full height and runs off
   the right edge of the viewport. */
.hero__media {
  position: relative;
  height: 100%;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keeps the subject and the horizon; nudge this to recompose. */
  object-position: 66% center;
}

/* Scroll cue */
.hero__cue {
  position: absolute;
  left: var(--gutter);
  bottom: var(--space-6);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--step--1);
  color: var(--color-muted);
  z-index: 1;
}
.hero__cue .rail {
  width: 1px; height: 34px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}
.hero__cue .rail::after {
  content: "";
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--color-ocean);
  animation: cue-slide 2.2s var(--ease-io) infinite;
}

/* ========================================================
   ABOUT  (styled here; content in Step 3)
   ======================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about__portrait {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, var(--color-ocean-tint), var(--color-sand-soft));
  box-shadow: var(--shadow-md);
  position: sticky;
  top: var(--space-9);
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__body p { color: var(--color-muted); font-size: var(--step-1); max-width: 58ch; }
.about__body p + p { margin-top: var(--space-5); }
.about__body .lead-line {
  color: var(--color-ink);
  font-size: var(--step-2);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-6);
}
.about__facts {
  margin-top: var(--space-7);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5) var(--space-6);
}
.about__fact dt {
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-faint);
  margin-bottom: 0.35rem;
}
.about__fact dd { font-weight: 500; }

/* ========================================================
   GENERIC GRID SHELLS  (populated by JS in later steps)
   ======================================================== */
.grid-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.grid-dev {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.grid-graphics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* Photography horizontal rail */
.photo-rail {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  padding-bottom: var(--space-5);
  scroll-snap-type: x mandatory;
}
.photo-rail > * { scroll-snap-align: start; }

/* Experience timeline */
.timeline { position: relative; margin-top: var(--space-6); }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--color-border);
}

/* Skills cloud */
.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  max-width: 60ch;
}

/* Contact */
.contact { text-align: center; }
.contact__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-4);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  max-width: 18ch;
  margin-inline: auto;
}
.contact__title .serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--color-ocean); }
.contact__lead { margin: var(--space-5) auto 0; color: var(--color-muted); font-size: var(--step-1); max-width: 46ch; }
.contact__actions { margin-top: var(--space-7); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: center; }

/* Footer */
.footer {
  padding-block: var(--space-7);
  color: var(--color-muted);
  font-size: var(--step--1);
}
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ========================================================
   PROJECT CARDS (Featured + Development)
   ======================================================== */
.project { display: flex; flex-direction: column; }
.project__media,
.dev__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(160deg, var(--color-sand-soft), var(--color-ocean-tint));
}
.project__media img,
.dev__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.card:hover .project__media img,
.card:hover .dev__media img { transform: scale(1.05); }
img.is-missing { position: relative; }
img.is-missing::after {
  content: "Image placeholder";
  position: absolute; inset: 0;
  display: grid; place-content: center;
  color: var(--color-faint); font-size: var(--step--1);
  background: linear-gradient(160deg, var(--color-sand-soft), var(--color-ocean-tint));
}
.project__role {
  position: absolute; top: var(--space-4); left: var(--space-4);
  font-size: var(--step--1); font-weight: 500;
  padding: 0.4em 0.85em; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--color-border-soft);
}
.project__body,
.dev__body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); flex: 1; }
.project__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.project__title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); }
.project__year { color: var(--color-faint); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.project__desc,
.dev__desc { color: var(--color-muted); }
.project__tech { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.project__links { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: auto; padding-top: var(--space-2); }
.project__links .btn { padding: 0.6em 1.1em; }

.dev__body { padding: var(--space-5); gap: var(--space-3); }
.dev__title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: var(--tracking-tight); }

.data-hint { color: var(--color-muted); font-size: var(--step-0); grid-column: 1 / -1; padding: var(--space-6); border: 1px dashed var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.data-hint code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--color-ocean-deep); }

/* Enable 3D tilt */
.grid-projects, .grid-dev { perspective: 1200px; }
.card--tilt { transform-style: preserve-3d; }

/* ========================================================
   GRAPHIC DESIGN GALLERY
   ======================================================== */
.graphic { cursor: pointer; outline: none; }
.graphic__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--color-ocean-tint), var(--color-sand-soft));
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.graphic__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.graphic:hover .graphic__media { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.graphic:focus-visible .graphic__media { box-shadow: var(--shadow-lg); }
.graphic:hover .graphic__media img { transform: scale(1.06); }
.graphic__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--color-ink) 26%, transparent), transparent 46%);
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.graphic:hover .graphic__media::after { opacity: 1; }
.graphic__cap { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-3); }
.graphic__cap span { font-weight: 500; }
.graphic__cap small { color: var(--color-faint); font-variant-numeric: tabular-nums; }

/* Modal content */
.modal__img { aspect-ratio: 16 / 10; background: linear-gradient(160deg, var(--color-ocean-tint), var(--color-sand-soft)); }
.modal__img img { width: 100%; height: 100%; object-fit: cover; }
.modal__meta { padding: var(--space-7); display: flex; flex-direction: column; gap: var(--space-4); }
.modal__name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); letter-spacing: var(--tracking-tight); }
.modal__desc { color: var(--color-muted); max-width: 60ch; }
.modal__tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.modal__year { color: var(--color-faint); font-size: var(--step--1); }

/* ========================================================
   PHOTOGRAPHY RAIL
   ======================================================== */
.photo { flex: 0 0 auto; width: clamp(260px, 40vw, 460px); }
.photo__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--color-sand-soft), var(--color-ocean-tint));
  box-shadow: var(--shadow-sm);
}
.photo__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.photo:hover .photo__media img { transform: scale(1.05); }
.photo__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--color-ink) 22%, transparent), transparent 50%);
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.photo:hover .photo__overlay { opacity: 1; }
.photo__cap { margin-top: var(--space-4); display: grid; gap: 0.15rem; }
.photo__cap b { font-weight: 600; }
.photo__cap span { color: var(--color-muted); font-size: var(--step--1); }
.photo__cap small { color: var(--color-faint); font-size: 0.72rem; letter-spacing: 0.02em; }

/* ========================================================
   EXPERIENCE TIMELINE
   ======================================================== */
.tl-item { position: relative; padding-left: var(--space-7); padding-bottom: var(--space-7); }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--color-surface); border: 2px solid var(--color-ocean);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-year { font-size: var(--step--1); color: var(--color-ocean-deep); font-weight: 600; letter-spacing: 0.02em; }
.tl-role { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: var(--tracking-tight); margin-top: 0.2rem; }
.tl-org { color: var(--color-muted); }
.tl-desc { color: var(--color-muted); margin-top: var(--space-3); max-width: 60ch; }
