/* =========================================================
   Florian Lutze — Personal Site
   Design: paper & ink, sharp edges, one signal accent.
   ========================================================= */

:root {
  color-scheme: light;
  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #f1efe8;
  --bg-elev: #eae7de;
  --ink: #12120f;
  --ink-soft: #3d3c35;
  --muted: #67655b;
  --line: #d8d4c8;
  --line-strong: #b9b4a5;
  --card: #f8f6f0;
  --accent: #2851e3;
  --accent-text: #1e46cf;
  --accent-ink: #f7f8ff;
  --accent-soft: #ccd8ff;
  --contact-accent: #6f8cff;
  --contact-muted: #a3a096;

  --header-h: 76px;
  --wrap: 1400px;
  --gutter: clamp(20px, 4vw, 56px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0e;
  --bg-elev: #151513;
  --ink: #f2efe5;
  --ink-soft: #cfcabe;
  --muted: #918e82;
  --line: #2a2925;
  --line-strong: #403e37;
  --card: #171715;
  --accent: #6f8cff;
  --accent-text: #93a9ff;
  --accent-ink: #0a0f24;
  --accent-soft: #1a2450;
  --contact-accent: #2044c9;
  --contact-muted: #5f5d55;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* barely-there paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="dark"] body::after {
  opacity: 0.035;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, p, dl, dd, figure {
  margin: 0;
}

h1, h2, h3, h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

strong {
  font-weight: 600;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.3s ease;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.brand-mono {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
}

.brand-point {
  color: var(--accent-text);
}

.nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  margin-right: 8px;
}

.nav a {
  position: relative;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav a:hover {
  color: var(--ink);
}

.nav a:hover::after,
.nav a[aria-current]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav a[aria-current] {
  color: var(--ink);
}

.nav-foot {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.menu-toggle {
  display: none;
}

.menu-bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
}

.menu-bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.menu-toggle[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.menu-toggle[aria-expanded="true"] .menu-bars span:first-child {
  transform: translateY(4.75px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bars span:last-child {
  transform: translateY(-4.75px) rotate(-45deg);
}

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.accent {
  color: var(--accent-text);
}

.section {
  padding: clamp(80px, 10vw, 140px) 0;
  border-top: 1px solid var(--line);
}

#arbeiten {
  border-top: 0;
}

.section-head {
  margin-bottom: clamp(44px, 6vw, 72px);
}

.section-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.72fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-top: 22px;
}

.section h2,
.contact h2 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.section-title-row h2 {
  font-size: clamp(2.6rem, 5.6vw, 4.8rem);
}

.section-intro {
  justify-self: end;
  max-width: 42ch;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}

.hero-main {
  min-width: 0;
}

.hero-title {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 12.4vw, 11rem);
  font-weight: 500;
  line-height: 0.83;
  letter-spacing: -0.06em;
}

.hero-title .line {
  display: block;
}

.hero-lede {
  max-width: 56ch;
  margin-top: clamp(24px, 3vw, 36px);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.62;
  color: var(--ink-soft);
}

.hero-lede strong {
  color: var(--ink);
  box-shadow: inset 0 -0.34em 0 var(--accent-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn .arrow {
  transition: transform 0.25s ease;
}

.btn-solid {
  background: var(--ink);
  color: var(--bg);
}

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

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn:hover .arrow {
  transform: translateX(4px);
}

.profile-card {
  align-self: end;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  background: var(--card);
}

.profile-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-main {
  padding: 24px 24px 22px;
}

.profile-role {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.profile-company {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.profile-lead {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-lead span {
  color: var(--accent-text);
}

.profile-focus {
  margin-top: 22px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.profile-focus span {
  margin-right: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.profile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
}

.status-mark {
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.profile-foot a {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.profile-foot a:hover {
  color: var(--accent-text);
  border-color: var(--accent-text);
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(56px, 8vw, 96px);
  padding: 16px 0 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-arrow {
  display: inline-block;
  margin-left: 8px;
  color: var(--accent-text);
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(3px);
  }
}

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 15px 17px;
}

.marquee-group span {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.marquee-group i {
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  color: var(--accent-text);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- featured project ---------- */

.project-featured {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  border: 1px solid var(--line-strong);
  background: var(--card);
}

.project-media {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 480px;
  border-right: 1px solid var(--line-strong);
  background: var(--line);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-featured:hover .project-media img {
  transform: scale(1.025);
}

.media-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.project-featured:hover .media-label,
.game-card:hover .media-label,
.project-media:focus-visible .media-label,
.game-card:focus-visible .media-label {
  opacity: 1;
  transform: none;
}

.project-body {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3.2vw, 44px);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-body h3 {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.project-kicker {
  margin-top: 10px;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.project-desc {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.project-featured--code {
  grid-template-columns: 0.9fr 1.1fr;
}

.project-featured + .project-featured {
  margin-top: clamp(16px, 2vw, 24px);
}

.project-visual {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  overflow: hidden;
  border-left: 1px solid var(--line-strong);
  background-color: #12120f;
  background-image:
    radial-gradient(circle at 80% 0%, rgb(255 106 43 / 0.1), transparent 44%),
    linear-gradient(rgb(241 239 232 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(241 239 232 / 0.035) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  color: #f1efe8;
}

[data-theme="dark"] .project-visual {
  background-color: #0a0a09;
}

.visual-head,
.visual-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e8a7f;
}

.visual-head {
  border-bottom: 1px solid #2e2b25;
}

.visual-foot {
  border-top: 1px solid #2e2b25;
}

.visual-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #f1efe8;
}

.visual-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.project-visual .code {
  display: flex;
  flex: 1;
  align-items: center;
  margin: 0;
  padding: clamp(24px, 3vw, 42px);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: clamp(10.5px, 1.12vw, 12.5px);
  line-height: 1.9;
  color: #d6d2c8;
  scrollbar-color: #3f3c34 transparent;
  scrollbar-width: thin;
}

.project-visual .code code {
  display: block;
  font-family: inherit;
  white-space: pre;
}

.c-comment {
  color: #77746a;
}

.c-keyword {
  color: #ff8452;
}

.c-string {
  color: #7bd3c3;
}

.c-type {
  color: #f1efe8;
}

.visual-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: #2dd4bf;
  vertical-align: 1px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: auto;
  padding-top: 32px;
}

.project-links .text-link {
  margin-top: 0;
  padding-top: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
}

.tags li {
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: auto;
  padding-top: 32px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link .arrow {
  transition: transform 0.25s ease;
}

.text-link:hover {
  color: var(--accent-text);
  border-color: var(--accent-text);
}

.text-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* ---------- games ---------- */

.subsection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin: clamp(64px, 8vw, 100px) 0 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

.subsection-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.subsection-head p {
  max-width: 46ch;
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line-strong);
  background: var(--line-strong);
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  transition: background 0.25s ease;
}

.game-card:hover {
  background: var(--bg-elev);
}

.game-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.game-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.game-card:hover .game-media img {
  transform: scale(1.04);
}

.game-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 22px 24px;
}

.game-body h4 {
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.game-body > p {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.game-body .tags {
  margin-top: 18px;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.game-body .tags + .card-link {
  margin-top: 22px;
}

.card-link span {
  color: var(--accent-text);
  transition: transform 0.25s ease;
}

.game-card:hover .card-link span {
  transform: translate(2px, -2px);
}

/* ---------- archive ---------- */

.archive {
  margin-top: clamp(56px, 7vw, 84px);
}

.archive-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

.archive-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.archive-head p {
  font-size: 12.5px;
  color: var(--muted);
}

.archive-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.55fr) minmax(0, 0.8fr) 160px;
  gap: 24px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.archive-index {
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.archive-main h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.archive-main p {
  max-width: 60ch;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.archive-tech {
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.archive-status {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 7px;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.archive-status .status-mark {
  width: 5px;
  height: 5px;
  background: var(--line-strong);
}

/* ---------- about ---------- */

.section-about {
  background: var(--bg-elev);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}

.about-media {
  position: relative;
  z-index: 0;
}

.about-media::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  z-index: -1;
  border: 1px solid var(--line-strong);
}

.about-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 50%;
  border: 1px solid var(--line-strong);
  filter: saturate(0.88) contrast(1.02);
}

.about-media figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-text .section-head {
  margin-bottom: 28px;
}

.about-text h2 {
  margin-top: 20px;
  font-size: clamp(2.6rem, 5.2vw, 4.6rem);
}

.about-lede {
  max-width: 52ch;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.about-text > div > p + p {
  margin-top: 16px;
}

.about-text > div > p:not(.about-lede) {
  max-width: 62ch;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 40px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.fact {
  padding: 20px 16px 20px 0;
}

.fact + .fact {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.fact-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

.fact-label {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- cv ---------- */

.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
}

.cv-title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline {
  margin-top: 26px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.timeline > li {
  position: relative;
  padding-bottom: 32px;
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.timeline > li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -30px;
  width: 8px;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
}

.timeline > li.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
}

.time {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline h4 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.org {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.cv-desc {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.tech {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stints {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.stints li {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.stints li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stint-time {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stint-name {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-soft);
}

.stint-context {
  color: var(--muted);
  font-weight: 400;
}

.stint-context::before,
.stint-role::before {
  content: "·\00a0";
  color: var(--line-strong);
  font-weight: 400;
}

.stint-role {
  color: var(--accent-text);
}

/* ---------- contact ---------- */

.contact {
  position: relative;
  padding-top: clamp(80px, 10vw, 140px);
  background: var(--ink);
  color: var(--bg);
}

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

.contact .accent {
  color: var(--contact-accent);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(48px, 7vw, 100px);
  align-items: end;
  padding-bottom: clamp(80px, 9vw, 120px);
}

.contact h2 {
  margin-top: 22px;
  font-size: clamp(3.2rem, 9vw, 8rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.contact-lede {
  max-width: 52ch;
  margin-top: 28px;
  font-size: 15px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--bg) 62%, transparent);
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  letter-spacing: -0.03em;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-mail .arrow {
  transition: transform 0.25s ease;
}

.contact-mail:hover {
  color: var(--contact-accent);
  border-color: var(--contact-accent);
}

.contact-mail:hover .arrow {
  transform: translate(3px, -3px);
}

.contact-side {
  border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
}

.contact-label {
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--contact-muted);
}

.social-list li {
  border-top: 1px solid color-mix(in srgb, var(--bg) 16%, transparent);
}

.social-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.social-list a:hover {
  color: var(--contact-accent);
  padding-left: 6px;
}

.social-handle {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--contact-muted);
}

.social-list a:hover .social-handle {
  color: inherit;
}

.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--bg) 18%, transparent);
  background: var(--ink);
  color: var(--bg);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 26px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--contact-muted);
}

.footer-grid a {
  color: var(--bg);
}

.footer-grid a:hover {
  color: var(--contact-accent);
}

.footer-note {
  text-align: center;
}

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

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}

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

html.js .hero .eyebrow {
  animation: fade-up 0.7s 0.05s both;
}

html.js .hero-title .line:nth-child(1) {
  animation: rise 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

html.js .hero-title .line:nth-child(2) {
  animation: rise 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

html.js .hero-lede {
  animation: fade-up 0.7s 0.3s both;
}

html.js .hero-actions {
  animation: fade-up 0.7s 0.4s both;
}

html.js .profile-card {
  animation: fade-up 0.8s 0.35s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------- responsive ---------- */

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

  .game-card:last-child {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1.1fr 0.9fr;
  }

  .game-card:last-child .game-media {
    min-height: 300px;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .game-card:last-child .game-body {
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .profile-card {
    max-width: 540px;
  }

  .project-featured {
    grid-template-columns: 1fr;
  }

  .project-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .project-visual {
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
  }

  .text-link {
    margin-top: 0;
    padding-top: 28px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .about-media {
    max-width: 460px;
    order: 2;
  }

  .about-text {
    order: 1;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 64px;
  }

  .menu-toggle {
    display: grid;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    margin: 0;
    padding: 8px var(--gutter) 40px;
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .nav a {
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
  }

  .nav a::after {
    display: none;
  }

  .nav-foot {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    padding-top: 36px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .nav .nav-foot a {
    width: fit-content;
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--ink);
  }

  .cv-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .contact-side {
    max-width: 540px;
  }

  .footer-grid {
    flex-direction: column;
    gap: 8px;
  }

  .footer-note {
    text-align: left;
  }
}

@media (max-width: 800px) {
  .section-title-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }

  .section-intro {
    justify-self: start;
    max-width: 56ch;
  }

  .subsection-head,
  .archive-head {
    flex-direction: column;
    gap: 6px;
  }

  .subsection-head p {
    text-align: left;
  }

  .archive-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
  }

  .archive-index {
    grid-column: 1;
    grid-row: 1;
    padding-top: 0;
  }

  .archive-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .archive-tech {
    grid-column: 1;
    grid-row: 3;
    padding-top: 8px;
  }

  .archive-status {
    grid-column: 2;
    grid-row: 1;
    padding-top: 0;
  }

  .hero-foot span:last-child {
    display: none;
  }
}

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

  .game-card:last-child {
    display: flex;
    grid-column: auto;
  }

  .game-card:last-child .game-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-card:last-child .game-body {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .fact {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 16px 0;
  }

  .fact + .fact {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .fact-num {
    min-width: 72px;
  }

  .fact-label {
    margin-top: 0;
  }

  .project-body,
  .game-body {
    padding: 20px;
  }

  .project-visual .code {
    padding: 22px 20px;
    font-size: 10.5px;
  }

  .stints li {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 6px 0;
  }

  .stint-time {
    padding-top: 0;
  }

  .contact-mail {
    font-size: clamp(1.05rem, 5vw, 1.4rem);
  }

  .social-list a {
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .project-visual .code {
    padding: 18px 14px;
    font-size: 9.5px;
  }
}

@media (max-width: 340px) {
  .profile-role {
    font-size: 1.65rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .marquee-track {
    animation: none;
  }

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