:root {
  --bg: #fdfbf3;
  --surface: #fdf5ee;
  --surface-2: #f9e9d9;
  --border: rgba(5, 45, 63, 0.14);
  --ink: #052d3f;
  --text: #0d3b4f;
  --muted: #4d7180;

  --peach: #f5c0a2;
  --peach-soft: #fbe0d0;
  --mint-deep: #9bd4b7;

  --accent-ink: #b8632f;
  --accent-ink-deep: #9c4f22;

  --radius: 16px;
  --maxw: 1100px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Geist", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent-ink-deep); text-decoration-color: var(--peach); text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: currentColor; }

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

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

.hero__field {
  position: absolute; inset: 0;
  z-index: 0;
  background: var(--bg);
}
.hero__field canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}
.hero__field.is-static canvas { display: none; }

@media (max-aspect-ratio: 5 / 3) {
  .hero__field canvas { opacity: 0.5; }
}
.hero__field .static-fallback {
  position: absolute; inset: 0; display: none;
  background-image: radial-gradient(circle, rgba(5,45,63,0.14) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(60% 60% at 60% 30%, #000 0%, transparent 75%);
}
.hero__field.is-static .static-fallback { display: block; }

.hero, .section { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding-top: 96px; padding-bottom: 24px; }

.hero {
  position: relative; overflow: hidden;
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: 40px; padding-bottom: 40px;
  max-width: none;
}
.hero__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; position: relative; z-index: 1; }
.hero__content { max-width: 600px; }
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.1rem, 5.6vw, 4.2rem); line-height: 1.1;
  letter-spacing: -0.01em; margin: 0 0 20px;
  color: var(--ink);
}
.hero__title em { font-style: normal; font-weight: 800; color: var(--accent-ink-deep); }
.hero__lead { max-width: 600px; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.15rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0 0; }
.hero__socials { list-style: none; display: flex; flex-wrap: wrap; gap: 20px; margin-top: 26px; }
.hero__socials a {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted);
  text-decoration: none; padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center;
}
.hero__socials a:hover { color: var(--accent-ink-deep); }

.hero__scroll {
  display: none;
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; z-index: 1;
  transition: color 0.2s;
}
.hero__scroll:hover { color: var(--ink); }
.hero__scroll-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.hero__scroll-arrow {
  width: 22px; height: 22px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: scroll-bob 1.8s var(--ease) infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.5; }
  50% { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
}
.hero__scroll:focus-visible { outline: 2px solid var(--accent-ink-deep); outline-offset: 6px; }

@media (min-width: 781px) {
  .hero__scroll { display: flex; }
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
  min-height: 44px;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { color: var(--bg); background: var(--ink); box-shadow: 0 8px 24px rgba(34,29,23,0.22); }
.btn--primary:hover { background: var(--accent-ink-deep); box-shadow: 0 12px 30px rgba(122,58,40,0.3); }
.btn--ghost { color: var(--ink); background: rgba(250,246,239,0.7); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg); }

.section__head { margin-bottom: 34px; }
.section__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.01em; color: var(--ink); }

.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; }
.about__body p { margin-bottom: 16px; color: var(--text); max-width: 68ch; }
.about__aside { display: flex; flex-direction: column; gap: 16px; }
.card {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.card--info h3 { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink-deep); margin-bottom: 8px; }
.card--info p { color: var(--muted); font-size: 0.95rem; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.filter {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted);
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.2s; min-height: 44px;
}
.filter:hover { color: var(--ink); border-color: var(--accent-ink); }
.filter[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }

.projects__status { min-height: 1em; margin-bottom: 16px; font-size: 0.9rem; color: var(--muted); }
.projects__empty {
  display: none; padding: 40px 24px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted);
}
.projects__empty.is-visible { display: block; }

.projects { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.3s;
  position: relative; overflow: hidden;
}
.project::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(232,181,58,0.16), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.project:hover { transform: translateY(-4px); border-color: var(--accent-ink); background: var(--surface-2); box-shadow: 0 14px 34px rgba(5,45,63,0.1); }
.project:hover::before { opacity: 1; }
.project.is-hidden { display: none; }
.project__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.project h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink); }
.project__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.project__tags span {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent-ink-deep);
  padding: 3px 9px; border-radius: 6px; background: var(--peach-soft);
  border: 1px solid transparent;
}
.project p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.project__links { display: flex; gap: 16px; }
.project__links a { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; }

.portfolio__video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(5, 45, 63, 0.08);
}
.portfolio__video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

.footer { border-top: 1px solid var(--border); margin-top: 80px; }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.footer p { color: var(--muted); font-size: 0.9rem; }
.footer__links { display: flex; gap: 24px; }
.footer__links a { color: var(--muted); font-size: 0.9rem; padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center; }
.footer__links a:hover { color: var(--ink); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 780px) {
  .about { grid-template-columns: 1fr; gap: 28px; }
  .projects { grid-template-columns: 1fr; }
  .section { padding-top: 56px; }
  .hero { min-height: auto; padding-top: 56px; padding-bottom: 56px; }
  .hero__field canvas { opacity: 0.3; }
  .footer__inner { flex-direction: column; text-align: center; }
  html { scroll-padding-top: 24px; }
}

@media (max-width: 420px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
}
