/* Tunables */
:root {
  --bg: #0d0d0c;
  --panel: #161614;
  --text: #ebe8e2;
  --muted: #8b8984;
  --line: #2b2a27;
  --frame: 24px;         /* gap between page edge and content (desktop) */
  --bar-h: 64px;         /* top bar height */
  --logo-h: 40px;        /* ATTE logo height in the top bar */
  /* Wide grotesk like the old Adobe Portfolio site (Archivo, Google Fonts) */
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ribbon-h: 72px;     /* awards ribbon tile height */
  --ribbon-speed: 60s;  /* time for one full loop */
  --awards-text-speed: 45s; /* work-page awards ribbon loop time (pages override: ~60px/s) */
  --shine: rgba(255, 255, 255, 0.16); /* ribbon shine brightness */
  --shine-speed: 6s;    /* one shine sweep + pause */
  --wide: 118%;          /* font-stretch: 100% normal ... 125% widest */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--bar-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 14px/1.6 var(--font);
  font-stretch: var(--wide);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }

/* Small spaced uppercase labels (used in bar, rails, meta) */
.topbar-link, .rail a, .label, .meta dt, .footer {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand img { height: var(--logo-h); width: auto; }
.brand:hover { opacity: 0.7; }
.topbar-link { display: none; position: absolute; right: 16px; }

/* Vertical side rails */
.rail {
  position: fixed; top: var(--bar-h); bottom: 0;
  width: var(--frame);
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: center; padding: 24px 0;
}
.rail a { writing-mode: vertical-rl; transform: rotate(180deg); }
.rail-left { left: 0; }
.rail-right { right: 0; justify-content: center; }
.rail-right a { transform: none; }

main { margin: 0 var(--frame); }

/* Split section: image left, text right */
.split {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--bar-h));
  border-bottom: 1px solid var(--line);
}
.split-media { margin: 0; background: #000; overflow: hidden; }
.split-media img {
  width: 100%; height: 100%;
  max-height: calc(100vh - var(--bar-h));
  object-fit: cover; object-position: center 30%;
  position: sticky; top: var(--bar-h);
}
.split-text {
  background: var(--panel);
  display: flex; flex-direction: column;
  padding: clamp(32px, 6vw, 96px) clamp(24px, 5vw, 80px) 32px;
}

.display {
  margin: auto 0 0;
  font: 700 clamp(26px, 2.6vw, 38px)/1.15 var(--font);
  font-stretch: var(--wide);
  letter-spacing: -0.01em;
  text-align: center;
}

.bio {
  max-width: 46ch; margin: 56px auto auto;
  color: var(--muted);
}
.bio p { margin: 0 0 1em; }

.meta {
  display: flex; gap: 48px; margin: 56px 0 0;
  border-top: 1px solid var(--line); padding-top: 16px;
}
.meta dt { color: var(--muted); }
.meta dd { margin: 4px 0 0; }

/* Awards ribbon (very top of page): tiles side by side, loops right -> left */
.awards {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 60%); /* faint gloss on top edge */
}
/* Shine: a soft light band sweeps across the ribbon, then rests */
.awards::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, var(--shine) 50%, transparent 60%) no-repeat;
  background-size: 250% 100%;
  mix-blend-mode: screen;
  animation: shine var(--shine-speed) ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 0% 0; } 60%, 100% { background-position: 100% 0; } }
/* JS (js/ribbon.js) drives the loop and lets you drag the ribbon sideways */
.awards.is-js { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.awards.is-dragging { cursor: grabbing; }
.awards img { -webkit-user-drag: none; }
.awards-track {
  list-style: none; margin: 0; padding: 0;
  display: flex; width: max-content;
  animation: ribbon var(--ribbon-speed) linear infinite;
}
.awards-track li { flex: none; border-right: 1px solid var(--line); }
.awards-track img { height: var(--ribbon-h); width: auto; max-width: none; }
/* Track holds the list twice, so moving by half = one full seamless loop */
@keyframes ribbon { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .awards { overflow-x: auto; }
  .awards-track, .awards::after { animation: none; }
  .awards.is-js { overflow: hidden; } /* JS drag replaces the scrollbar */
}
.label { margin: 0 0 40px; text-align: center; font-weight: 400; color: var(--muted); }

/* Work grid */
.work { padding: 72px 0; border-bottom: 1px solid var(--line); }
.work-grid {
  list-style: none; margin: 0 auto; padding: 0 24px;
  max-width: 1400px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 24px;
}
.work-grid a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.work-grid img {
  grid-column: 1 / -1; width: 100%;
  aspect-ratio: 202 / 158; object-fit: cover;
  transition: opacity 0.2s;
}
.work-grid a:hover img { opacity: 0.75; }
.work-grid a:hover { color: inherit; }
.work-title { margin-top: 8px; font-weight: 700; text-transform: uppercase; }
.work-year { margin-top: 8px; color: var(--muted); }

/* Project pages (work/*.html) */
.project { padding: 72px 0; border-bottom: 1px solid var(--line); }
.project > * { max-width: 1200px; margin-left: auto; margin-right: auto; padding: 0 24px; }
.project-head { text-align: center; margin-bottom: 64px; }
.project-head .label { display: inline-block; margin-bottom: 32px; }
.project-head .display { font-size: clamp(32px, 5vw, 64px); }
.project-year { margin: 8px 0 0; color: var(--muted); letter-spacing: 0.18em; font-size: 10px; }
.project-text, .project-credits, .project-caption, .project-link { max-width: calc(60ch + 48px); }
.project-text { color: var(--muted); font-size: 15px; margin-bottom: 64px; }
.project-text p { margin: 0 0 1em; }
.project-caption { margin-bottom: 12px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.project-caption p { margin: 0; }
.project-credits {
  margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.project-credits p { margin: 0 0 0.5em; }
/* Per-work awards ribbon: same marquee as the home ribbon, text tiles, full width, right before credits */
.project > .project-awards {
  max-width: none; padding: 0; margin-top: 64px;
  border-top: 1px solid var(--line);
}
.project-awards .awards-track { animation-duration: var(--awards-text-speed); }
.project-awards li {
  padding: 0 32px; line-height: var(--ribbon-h); white-space: nowrap;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.project-awards + .project-credits { margin-top: 48px; border-top: 0; padding-top: 0; }
.project-text a, .project-credits a { text-decoration: underline; }
.project-media { margin-top: 0; margin-bottom: 24px; }
.project-media img, .project-grid img { width: 100%; }
.project-media--half img { width: 50%; margin: 0 auto; display: block; }
@media (max-width: 768px) { .project-media--half img { width: 100%; } }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.project-video { margin-bottom: 24px; }
.project-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.project-link { margin-bottom: 48px; text-align: center; }
.project-link a { display: inline-block; padding: 12px 24px; border: 1px solid var(--line); letter-spacing: 0.18em; font-size: 10px; text-transform: uppercase; }
.project-nav {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--line);
  font-weight: 700; text-transform: uppercase;
}
.project-nav span { display: block; font: 400 10px/1.6 var(--font); letter-spacing: 0.18em; color: var(--muted); }
.project-nav a:last-child { text-align: right; }

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  margin: 0 var(--frame); padding: 20px 0;
  color: var(--muted);
}
.footer-logo { flex-basis: 100%; min-width: 0; height: 72px; object-fit: contain; margin: 40px 0 32px; }

/* Mobile */
@media (max-width: 1024px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .rail { display: none; }
  .topbar { justify-content: flex-start; padding: 0 16px; }
  .topbar-link { display: block; }
  main, .footer { margin: 0; }
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split-media img { position: static; max-height: none; aspect-ratio: 4 / 5; }
  .split-text { padding: 48px 16px 32px; }
  .display { font-size: 26px; }
  .bio { margin-top: 40px; }
  .meta { gap: 32px; margin-top: 40px; }
  .work { padding: 56px 0; }
  .work-grid { grid-template-columns: 1fr; padding: 0 16px; gap: 32px; }
  .footer { padding: 20px 16px; }
  .footer-logo { height: 56px; margin: 24px 0; }
  :root { --logo-h: 36px; --ribbon-h: 48px; }
  .project { padding: 48px 0; }
  .project > * { padding: 0 16px; }
  .project-head { margin-bottom: 40px; }
  .project-text { margin-bottom: 40px; }
  .project-media, .project-video, .project-grid { margin-bottom: 16px; }
  .project-media, .project-video, .project-grid { padding: 0; }
  .project-grid { grid-template-columns: 1fr; gap: 16px; }
}
