/* ==========================================================================
   SPACES. by Selina — design system
   Inspired by the Swiss Folio system: one large type size doing the work,
   white ground, tiny mono metadata, frosted pill nav, rounded image cards.
   ========================================================================== */

@font-face {
  font-family: "Think";
  src: url("../fonts/Think.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Bachelorette";
  src: url("../fonts/Bachelorette.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Color: strict Swiss. Color arrives through photography only. */
  --ink: #0a0a0a;
  --ink-2: #4a4a4a;
  --ink-3: #8c8c8c;
  --line: rgba(0, 0, 0, 0.08);
  --paper: #ffffff;
  --paper-2: #f4f4f2;
  --pill: rgba(20, 20, 20, 0.62);
  --pill-text: #ffffff;

  /* Type */
  --font-display: "Think", "Helvetica Neue", Arial, sans-serif;
  --font-script: "Bachelorette", "Brush Script MT", cursive;
  --font-serif: "Times New Roman", Times, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* The one big size (reference: ~34px mobile, scales up on desktop) */
  --t-big: clamp(2.05rem, 1.3rem + 2.6vw, 3.4rem);
  --t-display: clamp(2.6rem, 1.4rem + 5.2vw, 6.4rem);
  --t-mono: 0.75rem;
  --lh-tight: 1.03;
  --ls-tight: -0.02em;

  /* Space & shape */
  --gutter: clamp(1rem, 1.6vw, 1.5rem);
  --section: clamp(4rem, 8vw, 8rem);
  --radius: 14px;
  --radius-lg: 22px;
  --nav-h: 56px;
  --max: 1680px;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--t-big);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------- Type utilities ---------- */
.display { font-family: var(--font-display); font-size: var(--t-display); line-height: 0.98; letter-spacing: -0.01em; text-transform: uppercase; }
.big { font-family: var(--font-serif); font-size: var(--t-big); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
.think { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0; }
.script { font-family: var(--font-script); text-transform: none; letter-spacing: 0; line-height: 1; }
.mono { font-family: var(--font-mono); font-size: var(--t-mono); line-height: 1.3; letter-spacing: -0.02em; text-transform: none; }
.muted { color: var(--ink-3); }
.center { text-align: center; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.5); }
.grid { display: grid; gap: var(--gutter); grid-template-columns: repeat(12, 1fr); align-items: start; }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Nav: floating frosted pill ---------- */
.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  height: var(--nav-h);
  width: min(92vw, 720px);
  border-radius: 999px;
  background: var(--pill);
  color: var(--pill-text);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 22px;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.02em; text-transform: uppercase; }
.nav__brand img { height: 22px; width: auto; filter: invert(1); }
.nav__links { display: none; gap: 26px; font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: -0.01em; }
.nav__links a { opacity: 0.72; transition: opacity 0.2s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { opacity: 1; }
.nav__toggle { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.nav__toggle span { display: block; width: 14px; height: 1.5px; background: currentColor; margin: 2px 0; transition: transform 0.3s, opacity 0.3s; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(2.75px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { transform: translateY(-2.75px) rotate(-45deg); }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__toggle { display: none; }
}

/* Full-screen menu (mobile) */
.menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) 2.5rem;
  opacity: 0; pointer-events: none; transition: opacity 0.35s;
}
.menu.is-open { opacity: 1; pointer-events: auto; }
.menu a { display: block; font-family: var(--font-display); font-size: clamp(2.6rem, 10vw, 5rem); line-height: 1.02; text-transform: uppercase; transform: translateY(20px); opacity: 0; transition: transform 0.5s, opacity 0.5s; }
.menu.is-open a { transform: none; opacity: 1; }
.menu.is-open a:nth-child(2) { transition-delay: 0.05s; }
.menu.is-open a:nth-child(3) { transition-delay: 0.1s; }
.menu.is-open a:nth-child(4) { transition-delay: 0.15s; }
.menu__meta { margin-top: 2rem; display: flex; justify-content: space-between; opacity: 0.6; }

/* ---------- Hero ---------- */
.hero { padding-top: calc(var(--nav-h) + 18px + clamp(3rem, 8vw, 7rem)); }
.hero__title { max-width: 18ch; }
.hero__title .script { font-size: 0.62em; display: inline-block; margin-left: 0.15em; transform: translateY(0.02em); }
.hero__lede { margin-top: clamp(2rem, 4vw, 3.5rem); max-width: 38ch; }
.hero__meta { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }

/* Logo lockup hero (home) */
.hero__logo { width: min(100%, 820px); margin: 0 auto clamp(2rem, 5vw, 4rem); }

/* ---------- Manifesto (the Studio text block) ---------- */
.manifesto { max-width: 1180px; }
.manifesto p + p { margin-top: 1.2em; }
.manifesto em { font-style: normal; font-family: var(--font-script); font-size: 1em; line-height: 0; }

/* ---------- Image cards ---------- */
.cards { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); display: block; }
.card__media { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; transform: scale(1.001); transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card--tall .card__media { aspect-ratio: 4 / 5; }
.card--wide .card__media { aspect-ratio: 16 / 9; }
.card:hover .card__media { transform: scale(1.035); }
.card__label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.25rem 1.4rem;
  color: #fff;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0));
}
.card__label .big { font-size: clamp(1.6rem, 1rem + 1.8vw, 2.4rem); }
.card__label .mono { opacity: 0.85; white-space: nowrap; }
.card--quiet .card__label { background: none; }

/* Masonry-ish: span helpers for the 12 col grid */
.span-12 { grid-column: span 12; }
.span-6 { grid-column: span 12; }
.span-4 { grid-column: span 12; }
@media (min-width: 700px) { .span-6 { grid-column: span 6; } .span-4 { grid-column: span 6; } }
@media (min-width: 1200px) { .span-4 { grid-column: span 4; } }

/* ---------- Service tags (stacked, like the reference) ---------- */
.tags { display: flex; flex-direction: column; align-items: center; gap: 0.1em; }
.tags span { font-family: var(--font-display); font-size: var(--t-big); text-transform: uppercase; color: var(--ink-3); transition: color 0.25s; }
.tags span:hover, .tags span.is-active { color: var(--ink); }
.tags--on-dark { color: #fff; }
.tags--on-dark span { color: rgba(255,255,255,0.45); }
.tags--on-dark span:hover, .tags--on-dark span.is-active { color: #fff; }
.tags-panel { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #111; min-height: 70vh; display: grid; place-items: center; padding: var(--section) var(--gutter); }
.tags-panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.tags-panel .tags { position: relative; }

/* ---------- Pill buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: -0.01em;
  background: var(--ink); color: var(--paper);
  transition: transform 0.25s, background 0.25s;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); background: #222; }
.btn--ghost { background: rgba(0,0,0,0.05); color: var(--ink); }
.btn--ghost:hover { background: rgba(0,0,0,0.09); }
.btn--lg { font-family: var(--font-display); font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem); text-transform: uppercase; padding: 0.9em 1.6em; }

/* ---------- CTA block ---------- */
.cta { text-align: center; }
.cta .display { margin-bottom: 2rem; }
.cta .script { display: block; font-size: 0.5em; margin-top: 0.4em; text-transform: none; }

/* ---------- People / list rows ---------- */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
@media (min-width: 900px) { .row { grid-template-columns: 2fr 3fr auto; } }
.row .mono { color: var(--ink-3); }
.row .think { font-size: 0.95em; }

/* ---------- Project filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filters button { border: 1px solid var(--line); border-radius: 999px; padding: 0.55em 1em; font-family: var(--font-mono); font-size: var(--t-mono); transition: background 0.2s, color 0.2s; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card[hidden] { display: none; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 0; }
.field { display: grid; gap: 0.4rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.field label { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--ink-3); }
.field input, .field textarea, .field select {
  font: inherit; font-family: var(--font-serif); font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem);
  letter-spacing: var(--ls-tight); line-height: 1.1;
  border: 0; outline: 0; background: transparent; padding: 0; color: var(--ink); width: 100%;
  border-radius: 0;
}
.field textarea { resize: vertical; min-height: 3.2em; }
.field input::placeholder, .field textarea::placeholder { color: rgba(0,0,0,0.22); }
.form__actions { padding-top: 2rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { padding: var(--section) 0 2rem; }
.footer__logo { width: min(100%, 560px); margin-bottom: 3rem; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.footer__row a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card__media, .btn { transition: none; }
}
