/* it-nørd — Swiss editorial style
   All tokens are custom properties so other styles can be added later as themes. */

:root {
  /* Color */
  --color-paper: #EFE9DC;
  --color-ink: #161616;
  --color-ink-muted: #4A4A4A;
  --color-accent: #D9553B;
  --color-on-ink: #EFE9DC;
  --color-on-accent: #161616;
  --logo-accent: var(--color-accent);

  /* Type families */
  --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type sizes */
  --font-display-xl: clamp(60px, 9vw, 150px);
  --font-display-lg: clamp(64px, 11vw, 160px);
  --font-display-md: clamp(48px, 8vw, 116px);
  --font-display-sm: clamp(44px, 6vw, 84px);

  /* Spacing */
  --space-2xs: 8px;
  --space-xs: 14px;
  --space-sm: 20px;
  --space-md: 28px;
  --space-lg: 40px;
  --space-xl: 48px;
  --space-2xl: 96px;
  --space-3xl: 104px;

  /* Borders & shape */
  --border-w: 1.5px;
  --border-hair: var(--border-w) solid var(--color-ink);
  --radius: 0;
  --stroke: 2px;

  /* Layout */
  --container: 1280px;
  --pad: 48px;
  --strip-h: 340px;
  --work-img-h: 280px;

  /* Motion */
  --ease-out-editorial: cubic-bezier(.2, .7, .2, 1);
}

@media (max-width: 1023px) {
  :root { --pad: 32px; --strip-h: 300px; }
}
@media (max-width: 767px) {
  :root { --pad: 20px; --strip-h: 360px; --work-img-h: 220px; --stroke: 1.5px; }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 17px/1.55 var(--font-sans);
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

/* Outlined display type */
.outline {
  color: transparent;
  -webkit-text-stroke: var(--stroke) var(--color-ink);
}
.outline .fill-accent { color: var(--color-accent); }

@supports not (-webkit-text-stroke: 1px black) {
  .outline { color: var(--color-ink); }
  .outline .fill-accent { color: var(--color-accent); }
}

/* ---------- Page frame ---------- */

.page-frame {
  position: fixed;
  inset: 14px;
  border: var(--border-hair);
  pointer-events: none;
  z-index: 50;
}
@media (max-width: 767px) {
  .page-frame { display: none; }
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 40px;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  color: var(--color-ink);
}
.logo svg {
  height: 52px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: var(--border-hair);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  text-transform: lowercase;
  text-decoration: none;
  background: transparent;
  color: var(--color-ink);
  transition: background-color 150ms ease, color 150ms ease;
}
.nav a:hover {
  background: var(--color-ink);
  color: var(--color-paper);
}
.nav a.is-primary {
  background: var(--color-ink);
  color: var(--color-paper);
}
.nav a.is-primary:hover {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

@media (max-width: 767px) {
  .site-header { padding-block: 28px; }
  .logo svg { height: 40px; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 18px 30px;
  border: var(--border-hair);
  border-radius: var(--radius);
  font: 600 18px/1.2 var(--font-sans);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--color-ink);
  color: var(--color-paper);
}
.btn--primary:hover {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-color: var(--color-ink);
}

.btn--email {
  background: var(--color-ink);
  color: var(--color-accent);
  font-size: 20px;
  overflow-wrap: anywhere;
}
.btn--email:hover {
  background: var(--color-paper);
  color: var(--color-ink);
}

/* ---------- Sections ---------- */

.section { padding-bottom: var(--space-3xl); }

/* ---------- Hero ---------- */

.hero { padding-top: 56px; }

.eyebrow {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-sm);
}

.hero__title {
  font-size: var(--font-display-xl);
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.hero__title .line { display: block; }

.hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg) var(--space-xl);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.hero__intro {
  max-width: 600px;
  font-size: 19px;
  line-height: 1.55;
}

/* Hero art strip */

.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: var(--strip-h);
  border-top: var(--border-hair);
  border-left: var(--border-hair);
}

.strip__cell {
  position: relative;
  overflow: hidden;
  border-right: var(--border-hair);
  border-bottom: var(--border-hair);
}

.bg-paper { background: var(--color-paper); }
.bg-ink { background: var(--color-ink); }
.bg-accent { background: var(--color-accent); }

.shape { position: absolute; }

.shape--triangle {
  top: 24px; bottom: 24px; right: 10%;
  width: 65%;
  background: var(--color-ink);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.shape--quarter {
  right: 0; bottom: 0;
  width: 110px; height: 110px;
  background: var(--color-ink);
  border-radius: 100% 0 0 0;
}

.shape--para {
  top: 30px; bottom: 30px; left: 15%; right: 15%;
  background: var(--color-ink);
  clip-path: polygon(35% 0, 100% 0, 65% 100%, 0 100%);
}

.shape--circle {
  top: 50%; left: 50%;
  height: 80%;
  aspect-ratio: 1;
  background: var(--color-accent);
  border-radius: 50%;
  translate: -50% -50%;
}

@media (max-width: 767px) {
  .strip {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
  .shape--quarter { width: 80px; height: 80px; }
  .shape--circle { height: 70%; }
}

/* ---------- Selected work ---------- */

.section-title {
  font-size: var(--font-display-sm);
  line-height: 0.95;
  margin-bottom: var(--space-lg);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: var(--border-hair);
  border-radius: var(--radius);
  background: var(--color-paper);
  color: var(--color-ink);
  text-decoration: none;
}

.work-card__media {
  position: relative;
  height: var(--work-img-h);
  overflow: hidden;
  border-bottom: 1px solid var(--color-ink);
}
.work-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease-out;
}
.work-card__media .shape { transition: transform 300ms ease-out; }

.work-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-sm);
}

.work-card__tag {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.work-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: break-word;
  text-decoration: underline transparent 2px;
  text-underline-offset: 5px;
  transition: text-decoration-color 150ms ease;
}

.work-card:hover .work-card__title { text-decoration-color: currentColor; }
.work-card:hover .work-card__media .shape { transform: translateX(8px); }
.work-card:hover .work-card__media img { transform: scale(1.03); }

/* Card placeholder shapes */
.ph-diag {
  inset: 0 0 0 30%;
  background: var(--color-accent);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
}
.ph-block {
  left: 12%; top: 22%;
  width: 46%; height: 56%;
  background: var(--color-ink);
}
.ph-semi {
  left: 50%; bottom: -1px;
  width: 52%; aspect-ratio: 2 / 1; max-height: 70%;
  margin-left: -26%;
  background: var(--color-paper);
  border-radius: 999px 999px 0 0;
}
.ph-wedge {
  top: 24px; bottom: 24px; left: 10%; right: 10%;
  background: var(--color-ink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

@media (max-width: 767px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- Project index ---------- */

.index {
  --index-cols: 48px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) 72px minmax(0, 1.2fr) 28px;
  margin-top: 72px;
  border-bottom: var(--border-hair);
}

.index__title {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-sm);
}

.index__head,
.index__row summary {
  display: grid;
  grid-template-columns: var(--index-cols);
  align-items: center;
  column-gap: var(--space-sm);
  padding-inline: 12px;
}

.index__head {
  padding-bottom: 10px;
  font-size: 13px;
  color: var(--color-ink-muted);
  text-transform: lowercase;
}

.index__row { border-top: var(--border-hair); }

.index__row summary {
  min-height: 64px;
  padding-block: 14px;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.index__row summary::-webkit-details-marker { display: none; }
.index__row summary:hover,
.index__row[open] summary {
  background: var(--color-ink);
  color: var(--color-paper);
}
.index__row summary:focus-visible { outline-offset: -4px; }

.index__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/* On desktop the meta spans sit directly in the row grid. */
.index__meta { display: contents; font-size: 13px; }
.index__meta span { overflow-wrap: anywhere; }

.index__toggle {
  justify-self: end;
  font: 500 22px/1 var(--font-mono);
}
.index__toggle::before { content: "+"; }
.index__row[open] .index__toggle::before { content: "\2212"; }

.index__peek {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-md);
  padding: var(--space-md) 12px var(--space-lg);
}

.index__art {
  position: relative;
  height: 160px;
  overflow: hidden;
  border: var(--border-hair);
}

.index__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

.index__line { font-size: 19px; font-weight: 600; }

.index__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  width: 100%;
  margin: 0;
}
.index__facts dt {
  font: 500 13px/1.4 var(--font-mono);
  color: var(--color-ink-muted);
  text-transform: lowercase;
  margin-bottom: 4px;
}
.index__facts dd { margin: 0; font-size: 16px; }

.index__stack { font-size: 13px; color: var(--color-ink-muted); }

.index__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

@media (max-width: 1023px) {
  .index { --index-cols: 40px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 64px 28px; }
  .index__role { display: none; }
}

@media (max-width: 767px) {
  .index { margin-top: 56px; }
  .index__head { display: none; }
  .index__row summary {
    grid-template-columns: 32px minmax(0, 1fr) 24px;
    grid-template-areas: "no name toggle" ". meta toggle";
    row-gap: 4px;
    column-gap: 12px;
    padding-inline: 8px;
  }
  .index__no { grid-area: no; }
  .index__name { grid-area: name; font-size: 24px; }
  .index__meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
  }
  .index__meta span + span::before { content: "· "; }
  .index__toggle { grid-area: toggle; }
  .index__peek { grid-template-columns: 1fr; padding-inline: 8px; }
  .index__art { height: 140px; }
  .index__facts { grid-template-columns: 1fr; }
}

/* ---------- Services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: var(--border-hair);
  border-left: var(--border-hair);
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 260px;
  padding: 36px var(--space-md);
  border-right: var(--border-hair);
  border-bottom: var(--border-hair);
  color: var(--color-ink);
}
.service.bg-accent { color: var(--color-on-accent); }
.service.bg-ink { color: var(--color-on-ink); }

.service__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 0.95;
  text-transform: uppercase;
}

.service__text { font-size: 16px; }

@media (max-width: 1023px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .services-grid { grid-template-columns: 1fr; }
  .service { min-height: 0; }
}

/* ---------- About ---------- */

.about {
  background: var(--color-ink);
  color: var(--color-on-ink);
  padding-block: var(--space-2xl);
}
.about .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg) var(--space-xl);
}

.about__title {
  font-size: var(--font-display-lg);
  line-height: 0.85;
}
.about__title .accent { color: var(--color-accent); }

.about__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 560px;
}

/* ---------- Contact & footer ---------- */

.contact {
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding-top: var(--space-2xl);
}

.contact__title {
  font-size: var(--font-display-md);
  line-height: 0.92;
}

.contact__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  margin-top: var(--space-lg);
}

.contact__plain { font-size: 14px; }
.contact__plain a { text-underline-offset: 3px; }

.site-footer {
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-xl);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-lg);
  font-size: 13px;
}

/* ---------- Product study pages ---------- */

.logo img { height: 52px; width: auto; display: block; }
@media (max-width: 767px) { .logo img { height: 40px; } }

.study__lead {
  max-width: 760px;
  margin-top: var(--space-lg);
  font-size: 21px;
  line-height: 1.5;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: var(--space-xl) 0 0;
  border-top: var(--border-hair);
  border-left: var(--border-hair);
}
.facts__cell {
  padding: var(--space-sm) var(--space-md);
  border-right: var(--border-hair);
  border-bottom: var(--border-hair);
}
.facts dt {
  font: 500 13px/1.4 var(--font-mono);
  color: var(--color-ink-muted);
  margin-bottom: 6px;
}
.facts dd { margin: 0; font-weight: 600; }

.parts {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: var(--border-hair);
}
.part {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md) 12px;
  border-top: var(--border-hair);
}
.part__no { padding-top: 10px; }
.part__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}
.part p { max-width: 760px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--border-hair);
  border-left: var(--border-hair);
}
.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 220px;
  padding: var(--space-md);
  border-right: var(--border-hair);
  border-bottom: var(--border-hair);
  color: var(--color-ink);
}
.stat.bg-ink { color: var(--color-on-ink); }
.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 6vw, 84px);
  line-height: 0.95;
  text-transform: uppercase;
}
.stat__label { font-size: 16px; }

.study__stack {
  margin-top: var(--space-md);
  font-size: 13px;
  color: var(--color-ink-muted);
}
.study__credit {
  margin-top: var(--space-2xs);
  font-size: 13px;
  color: var(--color-ink-muted);
}

.study__shows-title {
  font-size: var(--font-display-md);
  line-height: 0.9;
}
.study__shows-title .accent { color: var(--color-accent); }
.about__text .btn--email { border-color: var(--color-paper); background: var(--color-accent); color: var(--color-on-accent); }
.about__text .btn--email:hover { background: var(--color-paper); color: var(--color-ink); }

.study-next { border-bottom: var(--border-hair); }
.study-next a {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding-block: var(--space-xl);
  color: var(--color-ink);
  text-decoration: none;
}
.study-next__name {
  font-size: var(--font-display-sm);
  line-height: 0.95;
  text-decoration: underline transparent 3px;
  text-underline-offset: 8px;
  transition: text-decoration-color 150ms ease;
}
.study-next a:hover .study-next__name { text-decoration-color: var(--color-accent); }

.site-footer--paper {
  background: var(--color-paper);
  color: var(--color-ink);
  padding-top: var(--space-lg);
}
.site-footer a { text-underline-offset: 3px; }

@media (max-width: 1023px) {
  .facts, .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .study__lead { font-size: 19px; }
  .facts, .stats { grid-template-columns: 1fr; }
  .stat { min-height: 0; gap: var(--space-sm); }
  .part { grid-template-columns: 1fr; gap: 4px; padding-inline: 0; }
  .part__no { padding-top: 0; }
  .part__title { font-size: 28px; }
}

/* ---------- Motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; scale: 0.9; }
  to   { opacity: 1; scale: 1; }
}

.hero__title .line {
  animation: rise 600ms var(--ease-out-editorial) both;
}
.hero__title .line:nth-child(2) { animation-delay: 80ms; }

.strip .shape {
  animation: pop 500ms var(--ease-out-editorial) both;
  animation-delay: calc(680ms + var(--i, 0) * 60ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .work-card:hover .work-card__media .shape,
  .work-card:hover .work-card__media img { transform: none; }
}
