/* ---------- Fonts ---------- */
@font-face {
  font-family: "Recoleta";
  src: url("fonts/Recoleta-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Feature Display";
  src: url("fonts/FeatureDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("fonts/Sohne-Buch.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("fonts/Sohne-Kraftig.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #fffaf3;
  --ink: #1c1c1c;
  --mint: #d3e9e1;
  --lilac: #dbd6f4;
  --sand: #f4ecdf;
  --muted: rgba(28, 28, 28, 0.6);
  --soft: rgba(28, 28, 28, 0.32);
  --line: rgba(28, 28, 28, 0.1);

  --font-logo: "Recoleta", Georgia, serif;
  --font-display: "Feature Display", "Times New Roman", serif;
  --font-body: "Sohne", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --side-x: 48px;
  --side-y: 44px;
  --side-w: 248px;
  --divider-x: calc(var(--side-x) + var(--side-w) + 40px);
  --content-x: calc(var(--divider-x) + clamp(32px, 3.4vw, 56px));
  --gutter: clamp(32px, 4.8vw, 80px);
  --content-w: 900px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

::selection { background: var(--lilac); color: var(--ink); }

:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.pane:focus-visible { outline: none; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* Hide until GSAP plays the intro */
.is-loading .sidebar > *,
.is-loading .divider,
.is-loading .view { visibility: hidden; }

/* ---------- Sidebar ---------- */
/* The sidebar scrolls on short screens, which clips anything outside it, so it carries
   --bleed of left padding (offset back out) to keep hover highlights' rounded edges visible. */
.sidebar {
  --bleed: 10px;
  position: fixed;
  top: var(--side-y);
  bottom: var(--side-y);
  left: calc(var(--side-x) - var(--bleed));
  width: calc(var(--side-w) + var(--bleed));
  padding-left: var(--bleed);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 36px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
@media (min-width: 901px) and (max-height: 760px) {
  .sidebar { gap: 24px; }
  .nav { gap: 20px; }
  .nav-group ul { gap: 3px; }
  .sidebar-foot { gap: 12px; }
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  font-family: var(--font-logo);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  padding-bottom: 2px;
}
.sidebar-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.lang {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  isolation: isolate;
}
.lang-btn {
  position: relative;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { color: var(--bg); }
.lang-pill {
  position: absolute;
  top: 3px;
  left: 0;
  z-index: -1;
  height: 24px;
  border-radius: 999px;
  background: var(--ink);
}

.logo .char {
  display: inline-block;
  will-change: transform;
}
.logo .mask { display: inline-flex; overflow: hidden; padding: 0 0.04em 0.12em; margin: 0 -0.04em -0.12em; }

.nav { position: relative; display: flex; flex-direction: column; gap: 28px; }
.nav-group { display: flex; flex-direction: column; gap: 10px; }
.nav-group ul { display: flex; flex-direction: column; gap: 6px; }
.nav-heading { color: var(--muted); }

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  isolation: isolate;
  transition: color 0.3s var(--ease);
}
.nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}
.nav-group:not(.nav-group--work) .nav-item::before { background: var(--lilac); }
.nav-item:hover::before,
.nav-item:focus-visible::before { transform: scaleX(1); }
.nav-label { transition: transform 0.45s var(--ease); display: inline-block; }
.nav-item:hover .nav-label { transform: translateX(2px); }

.nav-item.is-active .nav-label { transform: translateX(11px); }

.nav-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 18px; }
.contact { display: flex; flex-direction: column; gap: 4px; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.clock #clock { color: var(--ink); margin-left: 4px; }

/* Underline link */
.link {
  position: relative;
  display: inline-block;
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.5s var(--ease);
}
.link:hover::after { transform: scaleX(1); transform-origin: left center; }

.divider {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--divider-x);
  width: 1px;
  background: var(--line);
  transform-origin: top center;
  z-index: 2;
}

/* ---------- Content pane ---------- */
.pane {
  --bleed: 12px;
  position: fixed;
  inset: 0 0 0 calc(var(--content-x) - var(--bleed));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 var(--gutter) var(--gutter) var(--bleed);
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.pane::-webkit-scrollbar { display: none; }

.view {
  width: 100%;
  max-width: var(--content-w);
  padding-top: var(--side-y);
}

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.04;
  margin: 0;
}
.display--xl { font-size: clamp(32px, 3.5vw, 52px); }
.display--lg { font-size: clamp(30px, 3.2vw, 44px); }

.split-line { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.split-word { display: inline-block; will-change: transform; }

.eyebrow { color: var(--muted); margin-bottom: 20px; display: flex; gap: 10px; align-items: center; }
.eyebrow .chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 12px;
}

.body-copy { color: var(--muted); max-width: 520px; display: flex; flex-direction: column; gap: 12px; line-height: 1.5; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.section-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--ink); margin: 0; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: clamp(170px, 16vw, 230px) minmax(0, 1fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: start;
  padding: 4px 0 112px;
}
.hero-text { display: flex; flex-direction: column; gap: 28px; }
.hero-text .eyebrow { margin-bottom: -8px; }
.hero .display--xl { font-size: clamp(40px, 4.4vw, 64px); line-height: 1; }
.hero-meta { display: flex; gap: 28px; color: var(--muted); flex-wrap: wrap; }
.hero-meta span { color: var(--ink); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Left padding leaves room for the tilted corners so the pane doesn't clip them */
.hero-visual { padding: 20px 6px 0 24px; will-change: transform; }
.hero-card {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  transform-origin: 50% 60%;
  will-change: transform;
}
.hero-card { aspect-ratio: 4 / 5; background: var(--sand); }
.hero-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  will-change: transform;
}

/* ---------- Blocks ---------- */
.block { margin-bottom: 88px; }

.logo-strip {
  overflow: hidden;
  padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.logo-track { display: flex; width: max-content; }
.logo-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px 0 0;
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.logo-item:hover { color: var(--ink); }
.logo-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  transition: transform 0.6s var(--ease), border-radius 0.6s var(--ease);
}
.logo-icon {
  width: 22px;
  height: 22px;
  background: var(--ink);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.45s var(--ease), transform 0.6s var(--ease);
}
.logo-item:hover .logo-mark { transform: rotate(-6deg) scale(1.08); border-radius: 50%; }
.logo-item:hover .logo-icon { background: var(--brand); transform: rotate(6deg); }

/* ---------- Work ---------- */
.work { padding-top: 8px; }

.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -8px 0 24px;
  padding: 12px 0;
  background: var(--bg);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 0.4s var(--ease);
}
.filters.is-stuck { box-shadow: 0 1px 0 var(--line); }
.filters-track { position: relative; display: flex; flex-wrap: wrap; gap: 6px; isolation: isolate; }
.filter {
  position: relative;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.filter:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(28, 28, 28, 0.22); }
.filter.is-active { color: var(--bg); box-shadow: none; }
.filter-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-radius: 999px;
  background: var(--ink);
}

.project { padding: 56px 0 24px; }
.project + .project { border-top: 1px solid var(--line); }
.project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 32px;
}
.project-desc { color: var(--muted); margin-top: 10px; max-width: 440px; }
.project-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding-top: 8px; color: var(--muted); }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip--web { background: var(--mint); }
.chip--email { background: var(--lilac); }
.chip--branding { background: var(--sand); }
.chip--social { background: color-mix(in srgb, var(--mint) 50%, var(--lilac)); }
.project-tags .chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; color: var(--ink); }

.nav-item.is-dim { opacity: 0.28; pointer-events: none; }
.nav-item { transition: color 0.3s var(--ease), opacity 0.5s var(--ease); }

/* ---------- Placeholder media ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--sand);
  aspect-ratio: var(--ratio, 4 / 3);
  isolation: isolate;
  transform: translateZ(0);
}
.media-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 1.1s var(--ease);
  will-change: transform;
}
.media[data-zoom]:hover .media-inner { transform: scale(1.035); }
.media--mint { background: var(--mint); }
.media--lilac { background: var(--lilac); }
.media--sand { background: var(--sand); }
.media--ink { background: var(--ink); color: var(--bg); }
.media-glyph {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 128px);
  line-height: 1;
  opacity: 0.9;
}
.media-shape {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: multiply;
  opacity: 0.55;
}
.media--ink .media-shape { mix-blend-mode: screen; opacity: 0.18; }
.media-tag {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 11px;
  opacity: 0.55;
}
.media[data-zoom] { cursor: none; }

/* Temporary: neutral light-gray placeholders until real project images are in.
   Delete this block to bring back the colored placeholders. */
.media.media--mint, .media.media--lilac, .media.media--sand, .media.media--ink { background: #ecebe8; color: var(--ink); }
.media .media-shape, .media .media-glyph { display: none; }

/* ---------- Gallery grid ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.media-grid .is-wide { grid-column: span 2; }
.media-grid figure { margin: 0; }
.media-grid figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; }

/* ---------- Buttons & rows ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.4s var(--ease), color 0.4s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--lilac);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { box-shadow: inset 0 0 0 1px transparent; }
.btn--solid { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn--solid::before { background: var(--mint); }
.btn--solid:hover { color: var(--ink); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 20px;
  padding: 14px 10px;
  margin: 0 -10px;
  border-radius: 6px;
  isolation: isolate;
}
.row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--mint);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.row:hover::before { opacity: 0.55; transform: scale(1); }
.row + .row { box-shadow: 0 -1px 0 var(--line); }
.row:hover + .row, .row:hover { box-shadow: none; }
.row-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.row-what p:first-child { color: var(--ink); }
.row-what p + p { color: var(--muted); margin-top: 4px; max-width: 440px; }
.row-where { color: var(--muted); text-align: right; }
.row-points { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; color: var(--muted); max-width: 480px; }
.row-points li { position: relative; padding-left: 14px; line-height: 1.42; }
.row-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--soft);
}

.footer-note {
  margin-top: 96px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- Cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
}
.cursor span {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.lightbox.is-open { pointer-events: auto; cursor: zoom-out; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 250, 243, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
}
.lightbox-media { position: absolute; top: 0; left: 0; transform-origin: 0 0; visibility: hidden; }
.lightbox-media .media { width: 100%; height: 100%; aspect-ratio: auto; }
.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  color: var(--muted);
  opacity: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  .sidebar {
    position: relative;
    inset: auto;
    width: auto;
    padding: 28px 20px 0;
    gap: 24px;
  }
  .nav { flex-direction: row; gap: 0; }
  .nav-group--work, .nav-indicator, .nav-heading { display: none; }
  .nav-group ul { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .nav-item.is-active .nav-label { transform: none; }
  .nav-item.is-active::before { transform: scaleX(1); }
  /* On mobile only the language switch stays from the footer */
  .sidebar-foot .contact, .sidebar-foot .clock { display: none; }
  .sidebar-foot { margin-top: 0; }
  .divider { position: relative; left: auto; top: auto; bottom: auto; width: auto; height: 1px; margin: 24px 20px 0; }
  .pane { position: relative; inset: auto; overflow: visible; padding: 36px 20px 48px; }
  .media-grid { grid-template-columns: 1fr; }
  .media-grid .is-wide { grid-column: auto; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row-where { text-align: left; }
  .hero { grid-template-columns: 1fr; padding-bottom: 72px; }
  .hero-visual { width: 170px; padding: 8px 0 0 14px; }
  .view { padding-top: 0; }
  .block { margin-bottom: 64px; }
  .hero .display--xl { font-size: clamp(38px, 11vw, 52px); }
  .project-head { grid-template-columns: 1fr; gap: 10px; }
  .project-meta { align-items: flex-start; }
  .project-tags { justify-content: flex-start; }
  .filters { margin-left: -20px; margin-right: -20px; padding: 10px 20px; overflow-x: auto; scrollbar-width: none; }
  .filters-track { flex-wrap: nowrap; width: max-content; }
  .cursor { display: none; }
  .media[data-zoom] { cursor: zoom-in; }
}

@media (hover: none) {
  .cursor { display: none; }
  .media[data-zoom] { cursor: zoom-in; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
