:root {
  --bg: #0d0d0d;
  --bg-raised: #131313;
  --fg: #f2f2ef;
  --fg-dim: #9a9a95;
  --fg-faint: #5c5c58;
  --accent: #ff4d1c;
  --line: #2a2a27;
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --maxw: 1160px;
}

.inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* --- atmosphere: grain + vignette, no gradients-on-white --- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,77,28,0.06), transparent 55%),
              radial-gradient(ellipse at 100% 100%, rgba(255,255,255,0.03), transparent 50%);
}

main, header, footer { position: relative; z-index: 2; }

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

/* --- topbar --- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px);
}

.topnav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.5rem);
}

.topnav a {
  position: relative;
  color: var(--fg-dim);
  transition: color 0.2s ease;
}
.topnav a:hover { color: var(--fg); }
.topnav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.topnav a:hover::after { width: 100%; }

.topnav .idx {
  color: var(--fg-faint);
  margin-right: 0.4em;
}

.navtoggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

/* --- hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--d) * 0.14s + 0.1s);
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(3.5rem, 13vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.tagline {
  max-width: 34rem;
  margin-inline: auto;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--fg-dim);
  margin-top: 1.8rem;
}

/* --- sections --- */
.section {
  padding: clamp(4rem, 10vw, 8rem) clamp(1.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.9rem;
}

.section h2 .idx {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 400;
}

.section-body p {
  max-width: 42rem;
  margin-inline: auto;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--fg-dim);
  margin-bottom: 1.2rem;
}
.section-body p:last-child { margin-bottom: 0; }

/* --- work list --- */
.work-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.work-item {
  border-bottom: 1px solid var(--line);
  padding: 2.2rem 0;
  display: block;
}

a.work-link { display: block; }
a.work-link .work-head h3 { transition: color 0.25s ease; }
a.work-link:hover .work-head h3 { color: var(--accent); }

.work-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.work-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.ext { color: var(--accent); font-size: 0.7em; }

.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  color: var(--fg-dim);
}
.tag-live { color: var(--accent); border-color: var(--accent); }

.work-item p {
  max-width: 44rem;
  margin-inline: auto;
  color: var(--fg-dim);
  margin-bottom: 0.9rem;
}

.work-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  letter-spacing: 0.03em;
}

/* --- experience --- */
.exp-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.exp-item {
  border-bottom: 1px solid var(--line);
  padding: 2.2rem 0;
}

.exp-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.exp-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.exp-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.03em;
  margin-bottom: 1.2rem;
}

.exp-highlights {
  list-style: none;
  max-width: 44rem;
  margin-inline: auto;
  text-align: left;
  display: inline-block;
}

.exp-highlights li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--fg-dim);
  margin-bottom: 0.7rem;
}
.exp-highlights li:last-child { margin-bottom: 0; }
.exp-highlights li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* --- education --- */
.edu-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem 4rem;
}

.edu-item h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 0.5rem;
}

.edu-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

/* --- skills --- */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem 3rem;
  max-width: 56rem;
  margin-inline: auto;
}

.skill-group {
  flex: 1 1 220px;
  max-width: 260px;
}

.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.skill-group p {
  color: var(--fg-dim);
  font-size: 1rem;
  line-height: 1.7;
}

/* --- contact --- */
.contact {
  border-bottom: 1px solid var(--line);
}

.big-link {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 4rem);
  display: inline-block;
  position: relative;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.3rem;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.big-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.2rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.social-row a { color: var(--fg-dim); transition: color 0.2s ease; }
.social-row a:hover { color: var(--fg); }

.footer {
  padding: 2rem clamp(1.5rem, 4vw, 3.5rem) 3rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  text-align: center;
  position: relative;
  z-index: 2;
}

/* --- responsive --- */
@media (max-width: 720px) {
  .topnav { display: none; }
  .navtoggle { display: block; }
  .topnav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-raised);
    padding: 1.5rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .section {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
