/* petergpt.dk — plain CSS, no build step, no external requests. */

:root {
  color-scheme: dark;
  --bg: #0c0a13;
  --surface: #171324;
  --surface-2: #1f1932;
  --text: #f4ecdd;
  --muted: #bbb1c9;
  --line: rgba(255, 255, 255, 0.1);
  --brass: #e8b074;
  --coral: #ff8b67;
  --mint: #72d6c2;
  --violet: #a98bff;

  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --radius: 24px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --max: 1120px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }

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

.mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ───────── Backdrop: glows, dot grid, cello-ring ripples ───────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 88% -8%, rgba(169, 139, 255, 0.2), transparent 62%),
    radial-gradient(48rem 34rem at -8% 8%, rgba(232, 176, 116, 0.16), transparent 62%),
    radial-gradient(50rem 36rem at 60% 112%, rgba(114, 214, 194, 0.1), transparent 62%),
    var(--bg);
}

.backdrop::before {
  content: "";
  position: absolute;
  top: -22vw;
  right: -22vw;
  width: 64vw;
  height: 64vw;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 38px, rgba(232, 176, 116, 0.07) 39px 40px);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 70%);
  mask-image: radial-gradient(circle, #000 20%, transparent 70%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1.3px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%);
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

/* ───────── Skip link + top bar ───────── */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--brass);
  color: #1b1208;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(12, 10, 19, 0.85), rgba(12, 10, 19, 0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem 1.4rem;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand span { color: var(--brass); }

.topbar nav { display: flex; gap: 0.4rem; }
.topbar nav a {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.topbar nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

/* ───────── Hero ───────── */

.hero {
  display: grid;
  gap: 1rem 2rem;
  align-items: center;
  padding-block: clamp(1rem, 4vw, 3rem) clamp(3rem, 7vw, 6rem);
}

@media (min-width: 880px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; min-height: min(78svh, 700px); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(114, 214, 194, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(114, 214, 194, 0.55); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(114, 214, 194, 0); }
}

h1 {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

h1 .gpt {
  color: var(--coral);
  background: linear-gradient(100deg, var(--brass) 0%, var(--coral) 55%, #ff6fa5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  max-width: 24ch;
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.sub {
  max-width: 46ch;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.8rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--brass), var(--coral));
  color: #1b1208;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px -10px rgba(255, 139, 103, 0.6);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(255, 139, 103, 0.75); }
.button span { transition: transform 0.25s; }
.button:hover span { transform: translateY(3px); }

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  order: -1;
}
@media (min-width: 880px) { .hero-art { order: 0; } }

.mascot {
  position: relative;
  width: min(430px, 72vw);
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45));
}

.mascot .pupil { transition: transform 0.12s ease-out; }

.mascot-glow {
  position: absolute;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(232, 176, 116, 0.34), rgba(169, 139, 255, 0.16) 45%, transparent 70%);
  filter: blur(10px);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

.note {
  position: absolute;
  color: var(--brass);
  font-size: 1.8rem;
  opacity: 0;
  animation: rise 7s ease-in infinite;
}
.n1 { left: 62%; top: 24%; }
.n2 { left: 74%; top: 34%; animation-delay: 2.3s; color: var(--mint); }
.n3 { left: 52%; top: 30%; animation-delay: 4.6s; color: var(--violet); }

@keyframes rise {
  0% { opacity: 0; transform: translate(0, 20px) rotate(-8deg); }
  15% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(26px, -90px) rotate(12deg); }
}

/* ───────── Sections ───────── */

.projects, .about { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.section-head h2 {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section-sub { margin-top: 0.8rem; color: var(--muted); font-size: 1.05rem; }

.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  margin-top: 2.2rem;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid > li:last-child:nth-child(odd) { grid-column: auto; }
}

.grid > li { display: flex; }

/* ───────── Project cards ───────── */

.card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.35s;
}

/* pointer-following spotlight; falls back to a centered glow without JS */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%),
    color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%);
  transition: opacity 0.3s;
}

.card:hover, .card:focus-within {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 26px 60px -26px color-mix(in srgb, var(--accent) 55%, transparent);
}
.card:hover::before, .card:focus-within::before { opacity: 1; }

.card-art {
  height: 170px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card-art svg { width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card:hover .card-art svg { transform: scale(1.05); }

.card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.3rem 1.5rem 1.5rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags span {
  padding: 0.15rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card h3 {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* the title link covers the whole card */
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 3px solid var(--accent); outline-offset: -3px; }

.desc { margin-top: 0.6rem; color: var(--muted); }

.host {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.2rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}
.host .arrow { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card:hover .host .arrow, .card:focus-within .host .arrow { transform: translateX(6px); }

.more {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.6rem;
  padding: 1rem 1.3rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.blink {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* ───────── Card art animation ───────── */

.bob { animation: bob 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(5px) rotate(1deg); }
}

.bar { transform-box: fill-box; transform-origin: center; animation: eq 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.17s); }
@keyframes eq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

.car {
  offset-path: path("M54 124 C18 124 16 70 58 52 C98 34 130 74 172 62 C212 50 224 22 254 38 C286 56 262 104 220 124 C180 142 146 104 112 118 C92 126 72 124 54 124 Z");
  offset-rotate: auto;
  offset-distance: 0%;
  animation: lap 5.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 125, 92, 0.8));
}
@keyframes lap { to { offset-distance: 100%; } }

.node { animation: fire 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.3s); }
@keyframes fire { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ───────── About ───────── */

.about-card {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.6rem, 4vw, 2.8rem);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(30rem 16rem at 100% 0%, rgba(232, 176, 116, 0.1), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
@media (min-width: 820px) { .about-card { grid-template-columns: 1.4fr 1fr; } }

.about h2 {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.about-card p:not(.eyebrow) { max-width: 52ch; margin-top: 0.9rem; color: var(--muted); font-size: 1.05rem; }

.trio { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.trio li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 78px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trio .icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--brass);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s, border-color 0.3s;
}
.trio li:nth-child(2) .icon { color: var(--mint); }
.trio li:nth-child(3) .icon { color: var(--violet); }
.trio li:hover .icon { transform: translateY(-4px) rotate(-6deg); border-color: currentColor; }

/* ───────── Footer ───────── */

.footer { padding-block: 2.5rem 3.5rem; color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; }

/* ───────── Scroll reveal (only with JS) ───────── */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ───────── Reduced motion ───────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover, .card:focus-within, .button:hover { transform: none; }
  .card:hover .card-art svg { transform: none; }
  .note { display: none; }
  .car { offset-distance: 12%; }
}
