/* Digital Avenue studio site.
   Monochrome, huge grotesk type, one loud accent and eased motion.
   Sections: tokens, fonts, base, layout, header,
   labels and buttons, statement, work cards, numbered rows, contact,
   footer, page heads (404), motion, reduced motion. */

/* ---------- Tokens ---------- */

:root {
  /* Colours. Change the accent here and it changes everywhere. */
  --accent: #ff5a1f;
  --on-accent: #0d0d0d;
  --bg: #ffffff;
  --fg: #0d0d0d;
  --muted: #5a5a5a;
  --dark-bg: #0d0d0d;
  --dark-fg: #f5f5f2;
  --dark-muted: #a8a8a3;

  /* Type */
  --font-display: "Inter Tight", "Inter Tight Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Inter", "Inter Fallback", "Helvetica Neue", Arial, sans-serif;
  --fs-body: clamp(15px, 0.82rem + 0.3vw, 19px);
  --fs-small: clamp(13px, 0.76rem + 0.1vw, 15px);
  --fs-lead: clamp(1.4rem, 0.9rem + 2.2vw, 3.25rem);
  --fs-h3: clamp(1.6rem, 1rem + 2.6vw, 3.5rem);
  --fs-display: clamp(2.75rem, 7.5vw, 10rem);
  --fs-giant: clamp(5.5rem, 15vw, 22rem);
  --lh-display: 0.95;
  --track-display: -0.035em;

  /* Spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-section: clamp(80px, 11vw, 250px);

  /* Grid */
  --cols: 4;
  --gutter: 20px;
  --margin: 20px;
  --max: 1920px;

  /* Lines and motion */
  --rule: 2px;
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --dur: 1s;
}

@media (min-width: 700px) {
  :root { --cols: 8; --margin: 30px; }
}

@media (min-width: 1100px) {
  :root { --cols: 12; --margin: 40px; }
}

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("/assets/fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

/* Arial tuned to Inter's metrics, so the swap doesn't shift the layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 107%;
  ascent-override: 90.5%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Inter Tight Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 96%;
  ascent-override: 101%;
  descent-override: 25%;
  line-gap-override: 0%;
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--margin);
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--margin);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

.section {
  padding-block: var(--space-section);
}

.section + .section:not(.dark) { padding-top: 0; }

.ruled { border-top: var(--rule) solid currentColor; }

.dark {
  background: var(--dark-bg);
  color: var(--dark-fg);
  --muted: var(--dark-muted);
}

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

.site-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: 22px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span { color: var(--accent); }

.brand { display: grid; gap: 2px; }

.tagline {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 600;
}

.nav {
  display: flex;
  gap: var(--space-3);
  margin-left: auto;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.4s var(--ease);
}

.nav a:hover { background-size: 100% 2px; }

/* Work: a full-width product panel under the header, opened on hover, focus or tap.
   Rows echo the numbered rows on the page: ruled, big type, accent fill on hover. */
.nav-trigger {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 6px 0;
  border: 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background-size 0.4s var(--ease);
}

.nav-trigger sup {
  color: var(--muted);
  font-size: 0.7em;
  font-weight: 600;
  vertical-align: 0.5em;
  line-height: 0;
}

.nav-panel {
  position: absolute;
  top: calc(100% - 22px);
  left: var(--margin);
  right: var(--margin);
  z-index: 60;
  padding-top: 22px; /* bridges the header's bottom padding so hover holds */
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.5s var(--ease), visibility 0s 0.5s;
}

.nav-panel-inner {
  overflow: hidden;
  border-radius: 0 0 6px 6px;
  background: var(--dark-bg);
  color: var(--dark-fg);
  --muted: var(--dark-muted);
}

.nav-panel .nav-panel-label {
  margin: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
}

.nav .nav-product {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  column-gap: var(--space-3);
  row-gap: 4px;
  padding: clamp(18px, 2.4vw, 36px) var(--space-3);
  border-top: var(--rule) solid var(--dark-fg);
  background: none;
  transition: color 0.4s var(--ease);
}

.nav .nav-product::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--ease);
}

.nav .nav-product:hover,
.nav .nav-product:focus-visible { color: var(--on-accent); }

.nav .nav-product:hover::before,
.nav .nav-product:focus-visible::before { transform: scaleY(1); }

.nav-product-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-small);
}

.nav-product-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1rem + 3vw, 4.5rem);
  line-height: 1;
  letter-spacing: var(--track-display);
}

.nav-product-arrow {
  grid-column: -2;
  grid-row: 1;
  font-size: clamp(1.5rem, 1rem + 1.5vw, 2.75rem);
  line-height: 1;
  transition: translate 0.4s var(--ease);
}

.nav-product:hover .nav-product-arrow,
.nav-product:focus-visible .nav-product-arrow { translate: 6px 0; }

.nav-product-meta {
  grid-column: 2 / -1;
  font-size: var(--fs-small);
  font-weight: 600;
}

@media (min-width: 700px) {
  .nav .nav-product { grid-template-columns: 3rem 1fr auto auto; }
  .nav-product-meta { grid-column: 3; grid-row: 1; }
}

/* Games still in development/testing: listed, but not links yet. */
.nav .nav-product.is-upcoming { color: var(--muted); }
.nav .nav-product.is-upcoming::before { display: none; }

.nav-menu:hover .nav-trigger,
.nav-menu.is-open .nav-trigger { background-size: 100% 2px; }

.nav-menu:hover .nav-panel,
.nav-menu:focus-within .nav-panel,
.nav-menu.is-open .nav-panel {
  visibility: visible;
  clip-path: inset(0);
  transition-delay: 0s;
}

.nav-menu.is-closed .nav-panel { visibility: hidden; clip-path: inset(0 0 100% 0); }

/* ---------- Labels and buttons ---------- */

.label {
  display: block;
  margin-bottom: var(--space-4);
  font-size: var(--fs-small);
  font-weight: 600;
}

.label b { font-weight: 600; color: var(--muted); margin-right: 0.4em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}

.pill:hover {
  background: var(--accent);
  color: var(--on-accent);
  transform: translateY(-2px);
}

.pill .arrow { transition: transform 0.35s var(--ease); }
.pill:hover .arrow { transform: translateX(4px); }

.dark .pill { background: var(--dark-fg); color: var(--dark-bg); }
.dark .pill:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Statement ---------- */

.statement {
  position: relative;
  isolation: isolate;
  /* Darker than the usual muted grey, so the label reads on the video. */
  --muted: #3d3d3d;
}

/* A slow abstract loop behind the statement, full bleed with hard edges. */
.statement-media {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
}

.statement-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.statement .label,
.statement-body { grid-column: 1 / -1; }

.statement-body p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.45rem, 0.9rem + 2.2vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

@media (min-width: 1100px) {
  .statement-body { grid-column: 1 / 10; }
}

/* ---------- Work cards ---------- */

.work-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.work-head .label { margin-bottom: var(--space-2); }

.work-lead {
  display: grid;
  gap: var(--space-2);
  max-width: 46ch;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem);
}

.cards {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--space-5) var(--gutter);
  align-items: start;
}

.cards > * { grid-column: 1 / -1; }

@media (min-width: 700px) {
  .cards > :nth-child(odd) { grid-column: 1 / span 5; }
  .cards > :nth-child(even) { grid-column: 6 / -1; margin-top: 30%; }
}

@media (min-width: 1100px) {
  .cards > :nth-child(odd) { grid-column: 1 / span 7; }
  .cards > :nth-child(even) { grid-column: 9 / -1; margin-top: 40%; }
}

.card {
  --card-bg: var(--fg);
  --card-fg: #fff;
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--card-fg);
  text-decoration: none;
  transition: transform 0.6s var(--ease);
}

a.card:hover { transform: translateY(-4px); }

.card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--card-art, var(--card-bg));
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

/* Square key art floated in the middle, edges faded into the card. */
.card-media.is-centred img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: 92%;
  aspect-ratio: 1;
  translate: -50% -50%;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 86%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 86%, transparent 100%);
}

a.card:hover .card-media img { transform: scale(1.05); }

.card-body {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: 1;
  letter-spacing: var(--track-display);
}

.kicker {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card .kicker { color: inherit; opacity: 0.7; }

.card-text { max-width: 36ch; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-2);
}

.tags li {
  padding: 5px 12px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.2;
}

/* Two cards side by side, same width and height, no stagger. */
.cards.is-even { align-items: stretch; }

@media (min-width: 700px) {
  .cards.is-even > * { margin-top: 0; }
  .cards.is-even > :nth-child(odd) { grid-column: 1 / span 4; }
  .cards.is-even > :nth-child(even) { grid-column: 5 / -1; }
}

@media (min-width: 1100px) {
  .cards.is-even > :nth-child(odd) { grid-column: 1 / span 6; }
  .cards.is-even > :nth-child(even) { grid-column: 7 / -1; }
}

/* A card with no image: just the text, with more room around it. */
.card-plain .card-body {
  height: 100%;
  align-content: start;
  padding: clamp(28px, 3.5vw, 56px);
}

/* Smaller projects: a row of ruled columns. */
.projects {
  display: grid;
  gap: var(--space-5) var(--gutter);
}

@media (min-width: 700px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .projects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.project {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  padding-top: var(--space-3);
  border-top: var(--rule) solid currentColor;
}

.project h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 1rem + 1vw, 1.9rem);
  line-height: 1.05;
  letter-spacing: var(--track-display);
}

/* ---------- Numbered rows (how we work) ---------- */

.services-list { border-bottom: var(--rule) solid currentColor; }

.service {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--space-2);
  align-items: baseline;
  padding-block: clamp(28px, 4vw, 64px);
  border-top: var(--rule) solid currentColor;
}

.service::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--margin) * -1);
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--ease);
}

.service:hover::before { transform: scaleY(1); }
.service:hover { color: var(--on-accent); }

.service-num {
  grid-column: 1 / 2;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1;
}

.service h3 {
  grid-column: 2 / -1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: 1;
  letter-spacing: var(--track-display);
}

.service p { grid-column: 1 / -1; max-width: 46ch; }

@media (min-width: 700px) {
  .service-num { grid-column: 1 / 2; }
  .service h3 { grid-column: 2 / 6; }
  .service p { grid-column: 6 / -1; }
}

@media (min-width: 1100px) {
  .service-num { grid-column: 1 / 3; font-size: var(--fs-display); }
  .service h3 { grid-column: 3 / 8; font-size: clamp(2rem, 1rem + 3vw, 4.5rem); }
  .service p { grid-column: 9 / -1; }
}

/* ---------- Contact ---------- */

.contact .display { margin-bottom: clamp(32px, 5vw, 96px); }

.contact-email {
  display: inline-block;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 6.4vw, 9rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 0.08em no-repeat;
  transition: background-size 0.6s var(--ease), color 0.3s var(--ease);
}

.contact-email:hover { background-size: 100% 0.08em; color: var(--accent); }

.contact-note { margin-top: var(--space-4); color: var(--muted); max-width: 40ch; }

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

.site-footer { padding-block: var(--space-5) var(--space-3); }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--gutter);
  padding-top: var(--space-4);
  border-top: var(--rule) solid currentColor;
}

.footer-cols .footer-brand,
.footer-cols .footer-contact { grid-column: span 2; }

.footer-logo {
  display: block;
  width: clamp(110px, 9vw, 150px);
  height: auto;
}

@media (min-width: 900px) {
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-cols .footer-brand,
  .footer-cols .footer-contact { grid-column: auto; }
}

.footer-cols h2 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
}

.footer-cols li + li { margin-top: 6px; }

.footer-cols .muted { margin-left: 0.4em; color: var(--muted); font-size: var(--fs-small); }

.footer-cols a {
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.4s var(--ease);
}

.footer-cols a:hover { background-size: 100% 1.5px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-5);
  font-size: var(--fs-small);
  color: var(--muted);
}

.dark .footer-cols { border-color: var(--dark-fg); }

/* ---------- Page heads (404) ---------- */

.page-head { padding-top: clamp(40px, 7vw, 120px); }

.page-head .display { font-size: var(--fs-giant); line-height: 0.85; }

.page-head .lead {
  max-width: 30ch;
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 0.9rem + 1.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.not-found {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  align-items: start;
}

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

/* Reveals are hidden only once the inline script has set .js on <html>. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: calc(var(--d, 0) * 120ms);
}

.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Headlines come in line by line through masks. */
.lines .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.lines .line > span { display: block; }

.js .lines .line > span {
  transform: translateY(105%);
  transition: transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms + 100ms);
}

.js .lines.is-in .line > span { transform: none; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal],
  .js .lines .line > span { opacity: 1; transform: none; }

  .card:hover,
  .pill:hover,
  .card:hover .card-media img { transform: none; }
}
