/* largorate.dk — single shared stylesheet. Tokens first, then base, layout, components, utilities. */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --bg: #1f1f1f;
  --surface: #282828;
  --surface-2: #323232;
  --text: #f2f2f2;
  --muted: #9c9c9c;
  --border: #353535;
  --button: #d9d9d9;
  --button-text: #1f1f1f;
  --overlay: rgb(10 10 10 / 0.55);
  --focus: #ffd166;

  --radius: 2px;
  --gap: clamp(0.75rem, 1.6vw, 1rem);
  --content: 68rem;
  --prose: 42rem;
  --section: clamp(4rem, 10vw, 8rem);
  --stagger: clamp(3rem, 10vw, 6rem);
}

/* Base */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

a {
  color: var(--text);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #fff;
}

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

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
}

h3 {
  font-size: 1.1rem;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Layout */

.container {
  width: min(100% - 2 * clamp(1.25rem, 5vw, 2.5rem), var(--content));
  margin-inline: auto;
}

.prose {
  max-width: var(--prose);
}

.prose p,
.prose li {
  color: #d6d6d6;
}

.section {
  padding-top: var(--section);
}

.section-title {
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.section-title a {
  text-decoration: none;
}

.section-title a:hover {
  text-decoration: underline;
}

[id] {
  scroll-margin-top: 6rem;
}

.section-more {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.section-more a {
  color: var(--muted);
}

.section-more a:hover {
  color: var(--text);
}

.label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.label svg {
  width: 1rem;
  height: 1.5rem;
}

/* Skip link */

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--button);
  color: var(--button-text);
}

.skip-link:focus {
  top: 0.5rem;
}

/* Header & navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 2.1rem;
}

.nav-toggle {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding-block: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -1px 0 currentColor;
}

/* Progressive enhancement: collapsible nav on small screens (only when JS has run). */
@media (max-width: 40rem) {
  .js .nav-toggle {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    padding: 0.5rem clamp(1.25rem, 5vw, 2.5rem) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .js .site-nav a {
    padding-block: 0.65rem;
    font-size: 1rem;
  }

  html:not(.js) .site-header .container {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  html:not(.js) .site-nav ul {
    flex-wrap: wrap;
  }
}

/* Hero */

.hero {
  padding-top: clamp(3rem, 9vw, 6.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.hero h1 {
  max-width: 16ch;
}

.lead {
  max-width: 28rem;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
}

.portrait {
  width: clamp(10rem, 26vw, 17rem);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

@media (max-width: 40rem) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid .portrait {
    order: -1;
    width: 9rem;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--button);
  border-radius: var(--radius);
  background: var(--button);
  color: var(--button-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.button svg {
  width: 1rem;
  height: 1rem;
}

.button:hover {
  background: #fff;
  color: var(--button-text);
}

.button-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.button-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

/* Tiles: image-first links with a title overlay. */

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.tile img {
  width: 100%;
  aspect-ratio: var(--ratio, 4 / 5);
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tile--square {
  --ratio: 1;
}

.tile--tall {
  --ratio: 5 / 7;
}

.tile--wide {
  --ratio: 16 / 9;
}

.tile-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem;
  background: var(--overlay);
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tile-title {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 600;
}

.tile-meta {
  color: #d0d0d0;
  font-size: 0.8rem;
}

.tile:hover,
.tile:focus-visible {
  color: var(--text);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.04);
}

.tile:hover .tile-caption,
.tile:focus-visible .tile-caption {
  opacity: 1;
}

/* Touch devices can't hover, so keep titles visible at the bottom. */
@media (hover: none) {
  .tile-caption {
    inset: auto 0 0;
    align-items: flex-start;
    background: linear-gradient(transparent, rgb(0 0 0 / 0.75));
    padding-top: 3rem;
    text-align: left;
    opacity: 1;
  }
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Featured work: the right column starts lower, like a staggered masonry. */
.grid-2.staggered {
  padding-bottom: var(--stagger);
}

.grid-2.staggered > :nth-child(even) {
  margin-top: var(--stagger);
  margin-bottom: calc(-1 * var(--stagger));
}

@media (max-width: 52rem) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 34rem) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2.staggered {
    padding-bottom: 0;
  }

  .grid-2.staggered > :nth-child(even) {
    margin: 0;
  }
}

/* Contact */

.contact {
  text-align: center;
}

.contact .lead {
  margin-inline: auto;
}

.contact .actions {
  justify-content: center;
}

/* Project page */

.project-hero {
  padding-top: clamp(3rem, 9vw, 6.5rem);
}

.breadcrumb {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.project-cover {
  width: 100%;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  background: var(--surface);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
  padding: 1.5rem 0;
  border-block: 1px solid var(--border);
}

.facts div {
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0.25rem 0 0;
  font-weight: 500;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.25rem;
}

/* Portrait (phone) gameplay video beside the project text. */
.project-split {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.project-split .facts {
  margin-top: 0;
}

.project-video {
  position: sticky;
  top: 6rem;
  margin: 0;
}

.project-video video {
  width: 100%;
  background: var(--surface);
}

.project-split .media {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}

@media (max-width: 52rem) {
  .project-split {
    grid-template-columns: 1fr;
  }

  .project-video {
    position: static;
    max-width: 22rem;
    margin-inline: auto;
  }
}

/* Gallery of uncropped artworks with captions. */
.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  background: var(--surface);
}

.gallery figcaption strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.media {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  margin-top: 3rem;
}

.media figure {
  margin: 0;
}

figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #d0d0d0;
  font-size: 0.85rem;
}

/* Footer */

.site-footer {
  margin-top: var(--section);
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: var(--text);
  font-weight: 600;
}

.social {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--muted);
}

.social a:hover {
  color: var(--text);
}

.social svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Utilities */

.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;
}

.muted {
  color: var(--muted);
}
