/* =========================================================
   Romy Bornstein — Portfolio
   One shared stylesheet for every page.
   Direction: light, quiet, product-showcase. One typeface
   (Geist), near-black ink on off-white, hairline dividers,
   no decorative colour.
   ========================================================= */

:root {
  --bg:        #FAFAF8;   /* page */
  --surface:   #F1F0EC;   /* image panels, hover fills */
  --surface-2: #E8E6E0;   /* deeper panel tone */
  --ink:       #141413;   /* primary text + buttons */
  --ink-2:     #5E5D59;   /* secondary text */
  --ink-3:     #8C8B86;   /* labels, captions */
  --line:      #E4E2DC;   /* hairlines */
  --invert:    #FAFAF8;   /* text on ink */

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --nav-h: 64px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--invert);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

/* ---------- Type ---------- */

.label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.section-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(14px, 3vw, 32px);
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"] { color: var(--ink); }

@media (max-width: 420px) {
  .nav-links a { font-size: 13px; }
  .nav-links .nav-optional { display: none; }
}

/* ---------- Buttons ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--invert); }
.btn-primary:hover { background: #2E2D2A; border-color: #2E2D2A; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink); }

/* Links that are waiting for a real URL */
.is-placeholder { cursor: not-allowed; }

.text-link {
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.text-link .arrow { transition: transform 0.2s ease; }
.text-link:hover .arrow { transform: translateX(3px); }

/* ---------- Sections ---------- */

.section {
  padding: clamp(64px, 9vw, 112px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ---------- Intro ---------- */

.intro {
  padding: clamp(56px, 10vw, 128px) 0 clamp(56px, 8vw, 96px);
}

.intro-photo {
  width: clamp(168px, 22vw, 240px);
  height: clamp(168px, 22vw, 240px);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  margin-bottom: 32px;
  background: var(--surface);
}

.intro h1 {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 18px;
}

.intro-tagline {
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 34ch;
  margin-bottom: 32px;
}

/* entrance: one quiet fade on load */
.fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.fade-in--2 { animation-delay: 0.08s; }
.fade-in--3 { animation-delay: 0.16s; }
.fade-in--4 { animation-delay: 0.24s; }

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ---------- Project cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
}
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card[hidden] { display: none; }

.card-media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Stand-in until real project images exist: the project name, set quietly */
.media-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-3);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card-media img,
.card:hover .media-ph { transform: scale(1.03); }

.card-body { display: flex; flex-direction: column; gap: 4px; }

.card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-desc {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
}
.card .text-link { margin-top: 10px; }

/* ---------- Filter chips (all-projects page) ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.chips[hidden] { display: none; }
.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--invert);
}

/* ---------- Experience timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.tl-item {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 8px 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.tl-item:last-child { border-bottom: 1px solid var(--line); }

.tl-date {
  font-size: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.tl-role {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.tl-org { color: var(--ink-2); font-size: 15px; }
.tl-detail {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 60ch;
}
.tl-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  height: fit-content;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .tl-item { grid-template-columns: 1fr auto; }
  .tl-date { grid-column: 1; grid-row: 1; }
  .tl-type { grid-column: 2; grid-row: 1; }
  .tl-main { grid-column: 1 / -1; }
}

/* ---------- About ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; gap: 20px; } }

.prose p {
  font-size: clamp(17px, 1.8vw, 19px);
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 62ch;
}
.prose p + p { margin-top: 1em; }

/* ---------- Contact ---------- */

.contact-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 14px;
}
.contact-lead {
  color: var(--ink-2);
  font-size: 17px;
  margin-bottom: 28px;
  max-width: 48ch;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  font-size: 13px;
  color: var(--ink-3);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-inner a:hover { color: var(--ink); }

/* ---------- Page header (all projects) ---------- */

.page-head {
  padding: clamp(48px, 8vw, 96px) 0 clamp(28px, 4vw, 40px);
}
.page-head h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.page-head p {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 48ch;
}

/* ---------- Case study ---------- */

.case-head {
  padding: clamp(40px, 7vw, 80px) 0 clamp(32px, 5vw, 48px);
}
.back-link {
  display: inline-flex;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.back-link:hover { color: var(--ink); }

.case-head .label { margin-bottom: 12px; display: block; }
.case-head h1 {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 16px;
}
.case-summary {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink-2);
  max-width: 40ch;
  line-height: 1.45;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: clamp(32px, 5vw, 48px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.case-meta dt { margin-bottom: 4px; }
.case-meta dd { margin: 0; font-size: 15px; }
@media (max-width: 600px) { .case-meta { grid-template-columns: 1fr 1fr; } }

.case-hero-media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.case-hero-media .media-ph { font-size: clamp(28px, 5vw, 48px); }

.case-body {
  padding: clamp(48px, 8vw, 96px) 0;
}
.case-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px 32px;
  padding: clamp(28px, 4vw, 40px) 0;
}
.case-section h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
@media (max-width: 800px) { .case-section { grid-template-columns: 1fr; } }

.case-figure {
  margin: clamp(24px, 4vw, 40px) 0;
}
.case-figure .fig-media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--surface);
}
.case-figure figcaption {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 12px;
}

/* Next project — one big link, no decisions */
.next-project {
  display: block;
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 72px) 0;
}
.next-project .label { display: block; margin-bottom: 8px; }
.next-project-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
}
.next-project-title .arrow { transition: transform 0.25s ease; }
.next-project:hover .next-project-title .arrow { transform: translateX(6px); }

/* ---------- 404 ---------- */

.error-wrap {
  min-height: calc(100vh - var(--nav-h) - 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: 80px 0;
}
.error-wrap h1 {
  font-size: clamp(56px, 10vw, 112px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}
.error-wrap p { color: var(--ink-2); font-size: 18px; max-width: 40ch; margin-bottom: 8px; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { animation: none; opacity: 1; transform: none; }
  *, *::before, *::after { transition: none !important; }
}
