/* itsori.com — project pages (case study / showcase).
   Shared system from Figma "Portfolio Wireframes": nav, hero, header, section heads,
   captions, credits, project nav, footer. Page-specific sections live in each page's <style>. */

:root {
  --bg: #f0f0f0;
  --ink: #121212;
  --body: #262626;
  --muted: #6e6e6e;
  --blue: #0b4f9c;
  --yellow: #efd055;
  --logo-yellow: #efd052;
  --credits-bg: #e6e6e6;
  --credits-label: #2659e6;
  --white: #fff;

  --display: "Outfit", system-ui, sans-serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  --gutter: 80px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, h3 { margin: 0; font: inherit; }
[hidden] { display: none !important; } /* sections hidden with the attribute stay hidden even when a page gives them display rules */
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: none; }

.wrap { max-width: 1440px; margin: 0 auto; overflow: clip; }

/* Mono caption: tags, media captions, labels */
.caption {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.24px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Logo (mark + wordmark) — 1em = mark diameter ---------- */

.logo { position: relative; display: block; flex-shrink: 0; width: 174.144px; height: 36px; overflow: clip; }
.logo__mark {
  position: absolute;
  left: 2.1px;
  top: 0;
  width: 1em;
  height: 1em;
  font-size: 36.019px;
  -webkit-mask: url("assets/logo-mask-ellipse.svg") 0 0 / 1em 1em no-repeat;
  mask: url("assets/logo-mask-ellipse.svg") 0 0 / 1em 1em no-repeat;
}
.logo__mark > * { position: absolute; }
.logo__disc { inset: 0; width: 1em; height: 1em; }
.logo__u1 { left: 0.25218em; top: 0.16836em; width: 0.60189em; height: 0.5799em; }
.logo__u2 { left: 0.1666em; top: 0.25078em; width: 0.60189em; height: 0.5799em; }
.logo__o {
  left: 0.22987em;
  top: -0.04558em;
  font-family: var(--display);
  font-size: 0.78516em;
  font-weight: 900;
  line-height: normal;
  text-transform: uppercase;
  color: var(--logo-yellow);
}
.logo__word {
  position: absolute;
  left: 62.53px;
  top: 1.71px;
  font-family: var(--display);
  font-size: 25.84px;
  font-weight: 900;
  line-height: normal;
  text-transform: uppercase;
  color: var(--blue);
  white-space: nowrap;
}

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

.p-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--gutter);
  background: var(--bg);
}
.p-nav__links {
  display: flex;
  gap: 36px;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.p-nav__links a { position: relative; }
.p-nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.p-nav__links a:hover::after,
.p-nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.p-nav__status { display: flex; gap: 8px; align-items: center; }
.p-nav__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fb36b; }

/* ---------- Hero: logo over media; logo drifts down 0.5× and fades on scroll (project.js) ---------- */

.p-hero { position: relative; height: 900px; overflow: clip; background: var(--ink); }
.p-hero__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-hero::after { content: ""; position: absolute; inset: 0; background: rgba(18, 18, 18, 0.3); }
.p-hero__logo {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  will-change: transform, opacity;
}

/* ---------- 01 · Header ---------- */

.p-header { padding: 72px var(--gutter) 56px; }
.p-header__row { display: flex; gap: 80px; align-items: flex-start; }
.p-header__left { display: flex; flex-direction: column; gap: 32px; width: 560px; flex-shrink: 0; }
.p-header__title {
  font-family: var(--display);
  font-size: 72px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -2.16px;
}
.p-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.p-tags li { list-style: none; }
/* Project tag chip — <span> = plain, <a> = linked to a category page (set in tags.js) */
.p-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(18, 18, 18, 0.2); border-radius: 99px; font: 400 12px/16px var(--mono); letter-spacing: 0.24px; color: var(--ink); text-decoration: none; white-space: nowrap; }
a.p-tag { padding-right: 10px; transition: background-color 0.2s, border-color 0.2s; }
a.p-tag::after { content: ""; width: 10px; height: 10px; background: var(--blue); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 8L8 2M8 2H3.5M8 2V6.5' stroke='black' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 8L8 2M8 2H3.5M8 2V6.5' stroke='black' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform 0.2s; }
a.p-tag:hover, a.p-tag:focus-visible { background: var(--yellow); border-color: var(--yellow); }
a.p-tag:hover::after { transform: translate(1px, -1px); }
a.p-tag:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.p-header__right { display: flex; flex-direction: column; gap: 16px; width: 640px; padding-top: 12px; }
.p-fact { font-size: 17px; line-height: 1.3; color: var(--body); }
.p-fact b { margin-right: 0.6em; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.p-header__meta { font-size: 12px; line-height: 1.3; white-space: normal; }

.live-link { display: inline-flex; gap: 12px; align-items: center; align-self: flex-start; font-size: 16px; font-weight: 500; text-decoration: underline; text-underline-position: from-font; }
.live-link img { transition: transform 0.25s; }
.live-link:hover img { transform: rotate(45deg); }

/* ---------- Section head ---------- */

.p-head { display: flex; gap: 80px; align-items: flex-start; padding: 120px var(--gutter) 40px; }
.p-head h2 {
  flex-shrink: 0;
  width: 440px;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.8px;
}
.p-head p { width: 760px; font-size: 17px; line-height: 1.45; color: var(--muted); }

/* ---------- Credits ---------- */

.p-credits { display: flex; gap: 80px; align-items: flex-start; padding: 64px var(--gutter); background: var(--credits-bg); line-height: 1.3; }
.p-credits__head { display: flex; flex-direction: column; gap: 12px; width: 400px; flex-shrink: 0; white-space: nowrap; }
.p-credits__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22px; color: var(--credits-label); }
.p-credits__title { font-family: var(--display); font-size: 40px; font-weight: 500; letter-spacing: -0.6px; }
.p-credits__list { display: flex; flex-direction: column; gap: 8px; padding-top: 44px; font-size: 16px; font-weight: 500; color: var(--body); white-space: pre; }

/* ---------- Project nav ---------- */

.p-next { display: flex; align-items: center; justify-content: space-between; padding: 40px var(--gutter); border-top: 1px solid var(--ink); }
.p-next__back { display: flex; gap: 12px; align-items: center; font-size: 16px; font-weight: 500; line-height: 1.3; color: #404040; }
.p-next__back img { transition: transform 0.25s; }
.p-next__back:hover img { transform: translateX(-4px); }
.p-next__fwd { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.p-next__fwd .caption { line-height: 1.3; letter-spacing: 0; }
.p-next__row { display: flex; gap: 16px; align-items: center; }
.p-next__name { font-family: var(--display); font-size: 40px; font-weight: 500; line-height: 1.3; letter-spacing: -0.6px; white-space: nowrap; }

/* Disc arrow — Figma: "Hover: disc moves to x0,y8 (onto shadow)" */
.disc-arrow { display: block; width: 64px; height: 64px; overflow: visible; }
.disc-arrow__top { transition: transform 0.25s; }
.p-next__fwd:hover .disc-arrow__top { transform: translate(-8px, 8px); }

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

.p-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--gutter);
  background: var(--blue);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
/* same round icon buttons as the home footer / mobile menu, scaled down to keep the bar narrow */
.p-footer { padding: 16px var(--gutter); }
.p-footer__copy { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.66px; color: var(--white); }
.p-footer__icons { display: flex; gap: 8px; color: var(--white); }
.p-footer .sn-icon { width: 32px; height: 32px; }
.p-footer .sn-icon svg { width: 16px; height: 16px; }

/* ---------- Fixed-composition stages (absolute layouts drawn on the 1440 frame) ---------- */
/* Centred at 1440; on narrower screens the stage scales down (project.js sets --stage-scale). */

.stage-wrap { position: relative; overflow: clip; }
.stage {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1440px;
  transform-origin: top center;
  transform: translateX(-50%) scale(var(--stage-scale, 1));
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1200px) {
  :root { --gutter: 40px; }
  .p-header__row, .p-head { flex-direction: column; gap: 24px; }
  .p-header__left, .p-header__right, .p-head h2, .p-head p { width: auto; }
}

@media (max-width: 700px) {
  :root { --gutter: 16px; } /* CLAUDE.md: 16px gutter on mobile */
  .p-nav__links { gap: 20px; }
  .p-nav__status { display: none; }
  .p-hero { height: 100vh; height: 100svh; } /* HANDOFF §2: full small-viewport height */
  .p-hero__logo { max-width: 78vw; height: auto; }
  .p-header__title { font-size: 48px; letter-spacing: -1.4px; }
  .p-head { padding-top: 72px; }
  .p-head h2 { font-size: 32px; }
  .p-credits { flex-direction: column; gap: 0; }
  .p-credits__list { padding-top: 20px; white-space: normal; }
  .p-next { gap: 16px; padding-top: 32px; padding-bottom: 32px; }
  .p-next__back { flex-shrink: 0; }
  .p-next__fwd { min-width: 0; }
  .p-next__row { gap: 12px; }
  .p-next__name { font-size: 28px; line-height: 1.1; white-space: normal; text-align: right; }
  .disc-arrow { width: 48px; height: 48px; flex-shrink: 0; }
  .p-footer { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* the hidden attribute always wins over component display rules (hidden steps / placeholders) */

/* ---------- Shared type scale for section titles + intro text (one size across every project page) ---------- */
html body :is(.p-head, .km-head, .ga-head, .pp-head, .fv-head, .ff-directions) h2 {
  font-family: var(--display); font-size: 40px; font-weight: 500; line-height: 1.1; letter-spacing: -0.8px;
}
html body :is(.p-head, .km-head, .ga-head, .pp-head, .fv-head) p { font-family: var(--sans); font-size: 17px; line-height: 26px; }
@media (max-width: 700px) {
  html body :is(.p-head, .km-head, .ga-head, .pp-head, .fv-head, .ff-directions) h2 { font-size: 32px; letter-spacing: -0.6px; }
  html body .ff-directions h2 { white-space: normal; }
}

/* Typography: avoid single-word last lines (widows) */
html body :is(p, li, figcaption, dd) { text-wrap: pretty; }

/* Footer: Privacy link next to the copyright (Figma 530:165 "Left · legal"); mobile stacks legal row above icons (587:7168) */
.p-footer__legal { margin-left: 24px; color: inherit; text-decoration: underline; text-underline-offset: 3px; text-transform: uppercase; }
.p-footer__legal:hover { opacity: .75; }
@media (max-width: 520px) { .p-footer { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px var(--gutter) 28px; } }
