/* Diana Kostandian — portfolio

   SPACING SYSTEM
   Everything sits on an 8px scale (--s1 … --s16). Two named rules on top:
   --hp  20px  heading → its paragraph (the one deliberate exception to the 8 scale)
   --mt  32px  picture → the text under it
   Scenes use a 12-column grid with 24px gutters (see build.py for the layout rules). */

@font-face { font-family: 'Big Shoulders Display'; src: url('../fonts/big-shoulders-display.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('../fonts/schibsted-grotesk.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --body: #4d4d4d;
  --accent: #ff4400;
  --t-light: #e8e8e8;
  --t-dark: #171717;
  --t-cream: #f1ece0;
  --t-khaki: #e3e0c6;
  --t-backdrop: #e4e4e4;

  --display: 'Big Shoulders Display', Impact, 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Helvetica, sans-serif;

  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px;
  --s8: 64px; --s12: 96px; --s16: 128px; --s18: 144px;
  --hp: 20px;
  --mt: 32px;
  --gutter: 24px;
  --pad: 24px;

  --text: 13px;       /* descriptions, header, footer, cursor */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s12); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #ff80ea; }   /* orange highlight, bright fuchsia text */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

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

/* ---------- header / footer ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3);
  padding: 13px 0 11px; color: var(--muted); font-size: var(--text); line-height: 16px; /* optically even: ~15px above caps, ~15px below baseline */
  background: var(--bg);
}
.top nav { display: flex; gap: var(--s1); }
.top .home { color: var(--ink); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3);
  padding: var(--s5) 0 var(--s3); color: var(--muted); font-size: var(--text);
}
.foot .mail { color: var(--accent); }

/* ---------- type ---------- */
.mega {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  line-height: .84; letter-spacing: -.01em; text-align: center;
  font-size: min(280px, calc((100vw - 2 * var(--pad)) / 4.6));   /* "KOSTANDIAN" always fits the screen width */
}
.mega.sm { font-size: clamp(56px, 13vw, 200px); }
span.mega { display: block; }
.lede {
  margin: 0 auto; max-width: 32ch; text-align: center;
  font-family: var(--sans); font-weight: 700; font-size: 14px; line-height: 1.3;
  text-transform: uppercase;
}
.legend { margin: var(--s2) auto 0; max-width: 84ch; text-align: center; color: var(--muted); }

.hero { padding: var(--s12) 0 var(--s16); }
.clock-m { display: none; }   /* phones only, see below */
.hero .lede { margin-top: var(--hp); max-width: none; }
/* rotating 3D avatar floating over the name */
.hero-name { position: relative; }
.avatar {
  position: absolute; left: 50%; top: 52%; z-index: 2;
  width: clamp(150px, 25vw, 360px); aspect-ratio: 1;
  translate: -50% -50%; pointer-events: none;
}
.avatar video, .avatar img { display: block; width: 100%; height: 100%; object-fit: contain; }
.disciplines { margin-top: var(--s2); text-align: center; color: var(--ink); }
.disciplines li { line-height: 1.6; }

/* ---------- scenes: 12-column system ---------- */
.scenes { display: flex; flex-direction: column; gap: var(--s8); }   /* the same 64px between every project */

.scene {
  position: relative;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter); align-items: start;
}
.unit[data-link] { cursor: pointer; }
.unit {
  position: relative;   /* keeps each project's link area inside its own unit (two projects can share a row) */
  grid-column: var(--c) / span var(--s); grid-row: 1;
  margin-top: var(--d, 0);
  min-width: 0;
}

.f {
  position: relative; margin: 0;
  aspect-ratio: var(--r);
  background: var(--tone, var(--t-light));
  overflow: hidden;
}
.f.dark { --tone: var(--t-dark); }
.f.cream { --tone: var(--t-cream); }
.f.khaki { --tone: var(--t-khaki); }
.f.white { --tone: #ffffff; box-shadow: inset 0 0 0 1px var(--ink); }
.f .lbl { display: none; }   /* frame labels (fig. hero, website…) are for building only, never shown */
.f img, .f video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.1,1);
}
.unit.hot .f img { transform: scale(1.035); }
/* videos are never cropped: shown whole on black, no hover zoom */
.f.has-video { background: transparent; }   /* the video carries its own border colour */
/* once a frame holds a real image, drop the placeholder outline/tone so nothing peeks out at the edges */
.f:has(> img), .f.white:has(> img) { box-shadow: none; background: transparent; }
.f.has-video video { object-fit: contain; }
/* phone screens: rounded like a device and outlined so white screens don't melt into the page */
.unit.tall .f:has(> img) { border-radius: 14px; outline: 1px solid #d6d6d6; outline-offset: -1px; box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.unit.tall .f > img { border-radius: inherit; }

/* long case-study image: shown whole at its own height */
.f.long:has(> img) { aspect-ratio: auto; }
.f.long > img { position: static; height: auto; }
.unit.long.hot .f img { transform: none; }
/* the story stays in view while the long image scrolls past */
.unit.pin { position: sticky; top: var(--s12); }

.plate-in {
  display: grid; align-items: start; grid-template-columns: repeat(var(--pc), minmax(0, 1fr));
  gap: var(--gutter); padding: var(--gutter);
  background: var(--t-backdrop);
}

/* text under a picture */
.txt { margin-top: var(--mt); }
.note .txt:first-child { margin-top: 0; }
.note .txt + .txt { margin-top: var(--s4); }
.pname {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(28px, 3.4vw, 48px); line-height: 1; letter-spacing: -.03em;
  color: var(--ink); transition: color .2s;
}
.unit.hot .pname { color: var(--accent); }
.ntitle { font-family: var(--mono); font-weight: 500; font-size: 16px; line-height: 1.2; }
.desc { margin-top: var(--hp); max-width: 52ch; color: var(--body); font-size: var(--text); line-height: 1.55; }
.ptags { margin-top: var(--s2); color: var(--muted); }

.stretch::after { content: ''; position: absolute; inset: 0; z-index: 5; }

/* round cursor label (desktop only, set by main.js) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; will-change: transform;
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff;   /* the orange flower shape is drawn by ::before */
  font-family: var(--mono); font-size: var(--text); line-height: 1.25;
  scale: 0; transition: scale .3s cubic-bezier(.2,.75,.1,1);
}
.cursor.on { scale: 1; }
.cursor::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='%23ff4400'><circle cx='50' cy='50' r='36'/><circle cx='82.00' cy='50.00' r='18'/><circle cx='72.63' cy='72.63' r='18'/><circle cx='50.00' cy='82.00' r='18'/><circle cx='27.37' cy='72.63' r='18'/><circle cx='18.00' cy='50.00' r='18'/><circle cx='27.37' cy='27.37' r='18'/><circle cx='50.00' cy='18.00' r='18'/><circle cx='72.63' cy='27.37' r='18'/></g></svg>") center / contain no-repeat; }

/* ---------- about / contact ---------- */
.about { padding: var(--s16) 0 var(--s18); text-align: center; }
.about .lede { max-width: 44ch; }
.about .path { max-width: none; }
/* contact icons under About: black, orange on hover */
.socials { display: flex; justify-content: center; gap: var(--s3); margin-top: var(--s4); }
.socials a { display: block; color: var(--ink); transition: color .2s, transform .2s; }
.socials a:hover, .socials a:focus-visible { color: var(--accent); transform: translateY(-2px); }
.socials svg { display: block; width: 28px; height: 28px; }
@media (min-width: 1025px) { .about .path { white-space: nowrap; } }   /* one line on desktop */
.contact { text-align: center; }
.contact .mega { font-size: clamp(56px, 15vw, 220px); line-height: .82; }

/* ---------- case page ---------- */
.case-hero { padding: var(--s12) 0 var(--s8); text-align: center; }
.case-hero .count { color: var(--muted); margin-bottom: var(--s2); }
.case-hero .lede { margin-top: var(--hp); }
.case-hero .tags { margin-top: var(--s2); color: var(--muted); }
/* external link to the live site: black pill, orange on hover, same type as the cursor label */
.site-btn {
  display: inline-flex; align-items: center; gap: 10px; margin-top: var(--s3); padding: 12px 16px 12px 18px; border-radius: 6px;
  background: var(--ink); color: #fff; font-family: var(--mono); font-size: var(--text); line-height: 1.25;
  transition: background-color .2s;
}
.site-btn:hover, .site-btn:focus-visible { background: var(--accent); color: #fff; }
.site-btn .arr { flex: none; transition: transform .25s cubic-bezier(.2,.75,.1,1); }
.site-btn:hover .arr { transform: translateX(3px); }
/* floating award badge next to the case title (assets/img/<case>/badge.png, transparent PNG) */
.case-hero { position: relative; }
.badge {
  position: absolute; right: 6%; top: var(--s12); width: clamp(88px, 11vw, 160px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  rotate: 8deg; animation: badge-float 6s ease-in-out infinite; pointer-events: none;
}
.badge img { display: block; width: 100%; height: auto; }
.badge:not(:has(img)) { border: 1px dashed #c9c9c9; border-radius: 50%; }   /* placeholder until the file is added */
@keyframes badge-float { 50% { translate: 0 -10px; rotate: 4deg; } }

.meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--gutter);
  border-top: 1px solid var(--ink); padding-top: var(--s2); margin-bottom: var(--s8);
}
.meta div span { display: block; color: var(--muted); }
.meta.meta-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.intro {
  margin: 0 0 var(--s12); max-width: 30em;
  font-family: var(--sans); font-weight: 500; letter-spacing: -.01em;
  font-size: clamp(22px, 2.6vw, 38px); line-height: 1.15;
}

.next { display: block; padding: var(--s16) 0 var(--s3); text-align: center; }
.next .k { color: var(--muted); display: block; margin-bottom: var(--s2); }
.next .mega { transition: color .2s; }
.next:hover .mega { color: var(--accent); }

/* ---------- scroll motion (only when JS runs) ---------- */
.ln { display: block; overflow: hidden; padding: .08em 0 .02em; margin-top: -.08em; }   /* room for the round letters (O, G, S) that rise above the cap line */
.ln > span { display: block; }
.js .rv-lines .ln > span { transform: translateY(105%); transition: transform 1.1s cubic-bezier(.2,.75,.1,1); }
.js .rv-lines .ln:nth-child(2) > span { transition-delay: .09s; }
.js .rv-lines .ln:nth-child(3) > span { transition-delay: .18s; }
.js .rv-lines.in .ln > span { transform: none; }

.js .rv { opacity: 0; transform: translateY(var(--s3)); transition: opacity .9s ease, transform 1s cubic-bezier(.2,.75,.1,1); }
.js .rv.in { opacity: 1; transform: none; }

.js .scene > .unit {
  opacity: 0; transform: translateY(var(--s4));
  transition: opacity .9s ease, transform 1.15s cubic-bezier(.2,.75,.1,1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .scene.in > .unit { opacity: 1; transform: none; }

/* ---------- tablets and phones: one column, every picture full width,
   title + description after all of a project's pictures ---------- */
@media (max-width: 1024px) {
  .hero { padding-bottom: var(--s8); }          /* hero → first project: same 64px as between projects */
  .scene { display: flex; flex-flow: row wrap; align-items: flex-start; gap: var(--s2); }
  .scene > .unit > * { flex: 0 0 100%; min-width: 0; }
  .unit { display: contents; }                 /* pictures and text become direct items of the column */
  .unit > * { order: 0; }
  .unit > .txt { order: 1; margin-top: calc(var(--mt) - var(--s2)); }   /* 32px picture → text */
  .unit.g2 > * { order: 2; }                   /* second project of a shared row */
  .unit.g2 > .txt { order: 3; }
  .unit.main:not(.g2) > .f { order: -1; }       /* the big picture always comes first */
  #work .unit:not(.main) { display: none; }      /* homepage: one picture per project on tablets and phones */
  #work .unit.main > .f { aspect-ratio: 16 / 10; }   /* every preview card is the same horizontal cut */
  #work .unit.main > .f > img { object-position: 50% 30%; }   /* taller pictures keep their upper part (faces, headlines) */
  /* Trippant: frame the face and hair between the poster texts, so no lettering gets cut */
  #work .unit.main[data-link="work/trippant.html"] > .f > img { object-position: 50% 40%; transform: scale(1.302); transform-origin: 47.4% 10.3%; }
  .unit.pin > .txt { order: -2; }               /* phones: read the story first, then the long image */
  .unit.pin > .txt:first-child { margin-top: 0; }
  /* two or more small frames sit side by side under it */
  .scene:has(.unit.sm ~ .unit.sm) .unit.sm > .f { flex-basis: calc((100% - var(--s2)) / 2); }
  .unit.pair-next > :first-child { margin-top: calc(var(--s8) - var(--s2)); } /* same 64px as between other projects */
  .note .txt + .txt { margin-top: var(--s4); }
  .more { display: none; }
  .stretch::after { content: none; }           /* clicks on pictures are handled per project in main.js */
  .js .scene > .unit > * {
    opacity: 0; transform: translateY(var(--s4));
    transition: opacity .9s ease, transform 1.15s cubic-bezier(.2,.75,.1,1);
  }
  .js .scene.in > .unit > * { opacity: 1; transform: none; }
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --pad: 16px; --gutter: 16px; }
  .hero { padding: var(--s8) 0 var(--s6); }    /* hero → first project: same 48px as between projects */
  .scenes { gap: var(--s6); }                  /* 48px between projects on phones */
  .unit.pair-next > :first-child { margin-top: calc(var(--s6) - var(--s2)); }
  .plate-in { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--s2); }
  .plate-in:has(> .f:only-child) { grid-template-columns: 1fr; }
  .meta, .meta.meta-4 { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .intro { margin-bottom: var(--s8); }
  .about { padding: var(--s12) 0 var(--s12); }
  .next { padding-top: var(--s12); }
  /* header: name left, nav right on one line; the Yerevan time moves down, above the hero */
  .top { flex-wrap: nowrap; }
  .top .home { white-space: nowrap; }
  .top nav { gap: 6px; white-space: nowrap; }
  .top [data-clock] { display: none; }
  .badge { top: var(--s5); right: 0; width: 80px; }
  .clock-m { display: block; text-align: center; color: var(--muted); margin-bottom: var(--s5); }
  .hero, .case-hero { padding-top: var(--s5); }   /* the time sits evenly between the header and the big name */
}
@media (max-width: 370px) {
  .top .home, .top nav { font-size: 12px; }
  .top nav { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .next .mega, .f img, .f video, .pname { transition: none; }
  .badge { animation: none; }
  .js .rv, .js .scene > .unit, .js .scene > .unit > *, .js .rv-lines .ln > span { opacity: 1; transform: none; transition: none; }
}
