/* Colors are variables. Change them here to restyle the whole site. */
:root {
  --ease: cubic-bezier(.22, .61, .36, 1);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #0f1214;
  --panel: rgba(15, 18, 20, 0.88);
  --text: #e6e2d8;
  --muted: #9a978d;
  --line: #2c3236;
  --accent: #f0b84a;
  --hover: #ffffff;
  --video-bg: #07090a;
}
:root[data-theme="light"] {
  --bg: #e8f2f8;
  --panel: rgba(246, 250, 254, 0.90);
  --text: #162430;
  --muted: #556c7d;
  --line: #bcd4e6;
  --accent: #1971b0;
  --hover: #0b4570;
  --video-bg: #d2e4f0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  transition: background-color 2.5s var(--ease), color 2.5s var(--ease);
}

#city {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  image-rendering: pixelated;
  pointer-events: none;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color .25s var(--ease);
}
a:hover { color: var(--hover); }

.hero, .project, .plain, .link-row a {
  transition: background-color 2.5s var(--ease), border-color 2.5s var(--ease), color 2.5s var(--ease);
}

main { max-width: 1040px; margin: 0 auto; padding: 0 24px 80px; }
section { margin-bottom: 96px; }

.hero {
  margin: 10vh 0 12vh;
  padding: 36px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.small { color: var(--accent); margin: 0 0 16px; }
.small::after {
  content: "";
  display: inline-block;
  width: 8px; height: 1em;
  margin-left: 8px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

h1 {
  font-size: clamp(26px, 4.6vw, 42px);
  line-height: 1.2;
  margin: 0 0 20px;
  max-width: 20ch;
}
.lede { color: var(--muted); max-width: 52ch; margin: 0; }

.label {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin: 0 0 20px;
}
.label::before { content: "/ "; color: var(--accent); }

.project {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 40px;
}
.media-wrap { border-bottom: 1px solid var(--line); }
.media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--video-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.media + .media { border-top: 1px solid var(--line); }
.media video, .media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hint { margin: 0; color: var(--muted); font-size: 12px; }

.body { padding: 28px; }
.body h3 { margin: 0 0 6px; font-size: 24px; }
.body p { margin: 0 0 14px; max-width: 64ch; }
.meta, .tags { color: var(--muted); font-size: 13px; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 0 !important;
}

.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--panel);
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  box-shadow: 2px 2px 0 var(--line);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}

.actions a:hover {
  background: var(--accent);
  color: #0f1214;
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--hover);
  transform: translate(-1px, -1px);
}

:root[data-theme="light"] .actions a:hover {
  color: #ffffff;
}

.actions a:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 transparent;
}

.plain { background: var(--panel); border: 1px solid var(--line); padding: 24px 28px 10px; }
.plain p { max-width: 62ch; margin: 0 0 14px; }

.link-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.link-row a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 22px;
  border: 1.5px solid var(--line);
  border-radius: 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 2px 2px 0 var(--line);
  transition: all .2s var(--ease);
}
.link-row a:hover {
  background: var(--accent);
  color: #0f1214;
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--hover);
  transform: translate(-1px, -1px);
}
:root[data-theme="light"] .link-row a:hover {
  color: #ffffff;
}

.pixel-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

footer {
  padding: 48px 24px 64px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: transparent;
  border: none;
}
footer p { margin: 0; opacity: 0.75; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease), background-color 1.8s var(--ease), border-color 1.8s var(--ease), color 1.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (min-width: 760px) {
  .project { grid-template-columns: 1.35fr 1fr; }
  .project:nth-of-type(even) { grid-template-columns: 1fr 1.35fr; }
  .project:nth-of-type(even) .media-wrap { order: 2; border-left: 1px solid var(--line); border-bottom: 0; }
  .project:nth-of-type(odd) .media-wrap { border-right: 1px solid var(--line); border-bottom: 0; }
  .media { aspect-ratio: auto; min-height: 380px; height: 100%; }
}
@media (max-width: 520px) {
  .body { padding: 20px; }
  .media { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .small::after { animation: none; }
  * { transition-duration: .01ms !important; }
}
