/* =========================
   GLOBAL / TOKENS
========================= */

:root {
  --bg: #09090b;
  --bg-elevated: #131316;
  --ink: #f2f1ec;
  --ink-dim: #85858c;
  --ink-faint: #4d4d53;
  --accent: #ffab40;
  --line: #1d1d21;
  --line-strong: #29292f;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1240px;
  --gutter: 6vw;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

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

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

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

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

::selection { background: var(--accent); color: #0a0a0a; }

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* =========================
   GRID BACKGROUND
========================= */

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0,
    var(--line) 1px,
    transparent 1px,
    transparent calc((100% - 2 * var(--gutter)) / 11)
  );
  background-position: var(--gutter) 0;
  opacity: 0.5;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

section, header, footer { position: relative; z-index: 1; }

/* =========================
   NAVIGATION
========================= */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem var(--gutter);
  mix-blend-mode: difference;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.nav__logo .dot { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 2.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.nav__links a, .nav__github {
  position: relative;
  padding-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.nav__links a::after, .nav__github::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease);
}

.nav__links a:hover::after, .nav__github:hover::after { width: 100%; }

.nav__toggle { display: none; }

/* =========================
   HERO
========================= */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7rem var(--gutter) 2.4rem;
}

.hero__meta {
  display: flex;
  gap: 2rem;
}

.hero__boot {
  position: absolute;
  top: 7rem;
  right: var(--gutter);
  text-align: right;
  color: var(--ink-faint);
  white-space: pre-line;
  max-width: 280px;
  font-size: 0.68rem;
  line-height: 1.8;
}

.hero__main { margin: auto 0; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 12vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero__title .line {
  display: block;
  overflow: hidden;
}

.hero__title .line > * { display: inline-block; }

.hero__sub {
  max-width: 460px;
  margin-top: 2rem;
  color: var(--ink-dim);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.hero__status { display: flex; align-items: center; gap: 0.6rem; }

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255,171,64,0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,171,64,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(255,171,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,171,64,0); }
}

.hero__socials { display: flex; gap: 1.6rem; }

.hero__socials a { position: relative; }
.hero__socials a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--ink-dim);
  transition: width 0.3s var(--ease);
}
.hero__socials a:hover::after { width: 100%; }

.hero__scroll {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.hero__scroll span { animation: bob 1.6s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* =========================
   SECTION HEAD (shared)
========================= */

.section-head {
  padding: 8rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line-strong);
}

.section-num { display: block; margin-bottom: 1.2rem; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.01em;
}

/* =========================
   ABOUT
========================= */

.about__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 4vw;
  padding: 0 var(--gutter) 8rem;
  align-items: start;
}

.about__photo-frame {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line-strong);
  padding: 1px;
  position: relative;
}

.about__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(0.85) contrast(1.05) brightness(0.95);
  transition: filter 0.5s var(--ease);
}

.about__photo-frame:hover .about__photo-img {
  filter: grayscale(0.15) contrast(1.05) brightness(1);
}

.about__photo-caption {
  margin-top: 0.8rem;
}

.about__story p {
  color: var(--ink-dim);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 1.4rem;
}

.about__thesis {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 2;
  max-width: 480px;
}

/* =========================
   PROJECTS
========================= */

.project-case {
  display: block;
  padding: 4rem var(--gutter);
  border-top: 1px solid var(--line-strong);
  transition: background 0.4s var(--ease);
}

.project-case:hover { background: var(--bg-elevated); }

.project-case--next { cursor: default; }
.project-case--next:hover { background: none; }
.project-case--next { opacity: 0.55; }

.project-case__index { display: block; margin-bottom: 1rem; }

.project-case__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.project-case__meta {
  display: flex;
  gap: 1.6rem;
  margin: 1.6rem 0;
}

.project-case__desc {
  max-width: 520px;
  color: var(--ink-dim);
  margin-bottom: 1.6rem;
}

.project-case__link {
  display: inline-block;
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
}

.project-case__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.project-case:hover .project-case__link::after { transform: scaleX(1); }

/* =========================
   CONTACT
========================= */

.contact {
  padding: 8rem var(--gutter) 3rem;
  border-top: 1px solid var(--line-strong);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 6rem);
  line-height: 0.98;
  text-transform: uppercase;
  margin: 2rem 0 3rem;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.contact__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  text-transform: none;
  letter-spacing: 0;
  transition: padding-left 0.3s var(--ease), color 0.3s var(--ease);
}

.contact__links a .arrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-faint);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.contact__links a:hover {
  color: var(--accent);
  padding-left: 0.8rem;
}

.contact__links a:hover .arrow {
  color: var(--accent);
  transform: translateX(6px);
}

.footer {
  display: flex;
  justify-content: space-between;
  margin-top: 6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-strong);
}

/* =========================
   SCROLL ANIMATIONS
========================= */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
  .nav__logo { font-size: 0.85rem; }
  .about__grid { grid-template-columns: 1fr; }
  .about__photo-frame { max-width: 320px; }
  .hero__boot { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 6.5vw; }

  .nav__links { display: none; }
  .nav__github { display: none; }
  .nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
  }
  .nav__toggle span {
    width: 20px; height: 1px;
    background: var(--ink);
  }

  .hero { padding-top: 6rem; }
  .hero__meta { flex-direction: column; gap: 0.3rem; }
  .hero__footer { flex-direction: column; align-items: flex-start; gap: 1.4rem; }

  .section-head { padding-top: 5rem; }

  .project-case { padding: 3rem var(--gutter); }
  .project-case__meta { flex-wrap: wrap; gap: 1rem; }

  .footer { flex-direction: column; gap: 0.5rem; }
}
