/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #121214;
  --fg: #d8d8dc;
  --fg-dim: #6a6a72;
  --accent: #c8c8ce;
  --card-bg: #1a1a1e;
  --card-border: #2a2a30;
  --font: Georgia, "Times New Roman", serif;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ── Background Canvas ───────────────────────────── */
#bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── Nav ─────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(18, 18, 20, 0.6);
  border-bottom: 1px solid var(--card-border);
}

.nav-logo {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-ui);
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  transition: color 0.2s;
}

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

/* ── Main Layout ─────────────────────────────────── */

/* ── Hero ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.9;
  color: #1a1a1e;
  text-transform: lowercase;
  transition: font-family 0.3s;
  /* Matte finish */
  text-shadow:
    0 0 1px rgba(18, 18, 20, 0.6),
    0 1px 0 rgba(30, 30, 35, 0.25),
    0 -1px 0 rgba(8, 8, 10, 0.3);
}

.hero h1 span {
  display: inline-block;
  transition: font-family 0.3s, font-style 0.3s;
  transform-origin: center center;
  cursor: grab;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.hero h1 span:active {
  cursor: grabbing;
}

/* ── Content area (below hero) ───────────────────── */
.content {
  position: relative;
  background: var(--bg);
  isolation: isolate;
}

/* Matte titanium noise texture overlay */
.content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  filter: blur(0.5px);
  pointer-events: none;
}

.content-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  font-family: var(--font-ui);
}


/* ── Sections ────────────────────────────────────── */
.about, .projects, .contact {
  padding: 8rem 0 4rem;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  position: relative;
}

/* Glint line — light behind the page visible through a thin crack */
.section-label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background:
    radial-gradient(
      ellipse 180px 1px at var(--glint-x, 50%) 50%,
      rgba(200, 200, 210, calc(0.5 * var(--glint-opacity, 0))) 0%,
      rgba(200, 200, 210, calc(0.08 * var(--glint-opacity, 0))) 40%,
      transparent 100%
    ),
    linear-gradient(to right, rgba(42, 42, 48, 0.4), rgba(42, 42, 48, 0.4));
}

/* ── About ───────────────────────────────────────── */
.about-content p {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.5;
  max-width: 600px;
}

/* ── Projects ────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}

.project-card:hover {
  border-color: var(--fg-dim);
  transform: translateY(-2px);
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--fg-dim);
}

.project-tech {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  margin-top: 0.25rem;
}

.project-arrow {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 1.2rem;
  color: var(--fg-dim);
  transition: transform 0.2s, color 0.2s;
}

.project-card:hover .project-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* ── Contact / Links ─────────────────────────────── */
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.link-row a {
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.link-row a:hover {
  color: var(--accent);
}

/* ── Footer ──────────────────────────────────────── */
footer {
  position: relative;
  background: var(--bg);
  isolation: isolate;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background:
    radial-gradient(
      ellipse 180px 1px at var(--glint-x, 50%) 50%,
      rgba(200, 200, 210, calc(0.5 * var(--glint-opacity, 0))) 0%,
      rgba(200, 200, 210, calc(0.08 * var(--glint-opacity, 0))) 40%,
      transparent 100%
    ),
    linear-gradient(to right, rgba(42, 42, 48, 0.4), rgba(42, 42, 48, 0.4));
}

footer span {
  font-size: 0.8rem;
  color: var(--fg-dim);
  font-family: var(--font-ui);
}

/* ── Scroll Animations ───────────────────────────── */
.about, .projects, .contact {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.about.visible, .projects.visible, .contact.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 600px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    gap: 1.2rem;
  }

  main {
    padding: 0 1.5rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 6rem);
  }

  .about, .projects, .contact {
    padding: 5rem 0 3rem;
  }

  .about-content p {
    font-size: 1.2rem;
  }
}
