:root {
  --bg: #f4f1eb;
  --bg-deep: #ebe6dc;
  --ink: #121110;
  --ink-soft: #5c5852;
  --ink-faint: #9a948b;
  --accent: #e85d04;
  --accent-soft: rgba(232, 93, 4, 0.12);
  --line: rgba(18, 17, 16, 0.1);
  --font-display: "Syne", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Texture & ambient --- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
  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.5'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  transition: transform 0.6s var(--ease);
}

.orb-a {
  width: 55vw;
  height: 55vw;
  top: -15%;
  right: -10%;
  background: radial-gradient(circle, #ffd6a5 0%, transparent 70%);
}

.orb-b {
  width: 45vw;
  height: 45vw;
  bottom: 10%;
  left: -15%;
  background: radial-gradient(circle, #c8d6e5 0%, transparent 70%);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--pad);
  mix-blend-mode: difference;
  color: #fff;
}

.mark {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

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

.nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  transition: opacity 0.25s;
}

.nav a span {
  margin-right: 0.35rem;
  opacity: 0.5;
}

.nav a:hover,
.nav a.is-active {
  opacity: 1;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding: 4px;
}

.menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}

/* --- Reveal animation --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 7rem var(--pad) 0;
  max-width: var(--max);
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.hero-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(3.25rem, 11vw, 8.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 0;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .line-sub {
  margin-top: 0.05em;
}

.hero-title .word {
  display: inline-block;
  margin-right: 0.18em;
}

.hero-title .outline {
  -webkit-text-stroke: 1.5px var(--ink);
  color: transparent;
}

.hero-title .italic {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.hero-desc {
  max-width: 34ch;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  margin-bottom: 3rem;
}

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.link-arrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: relative;
  padding-bottom: 2px;
}

.link-arrow::after {
  content: " →";
  transition: transform 0.3s var(--ease);
  display: inline-block;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--ink-faint), transparent);
  animation: scroll-drop 2s ease-in-out infinite;
}

@keyframes scroll-drop {
  0%, 100% { transform: scaleY(0.3); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* --- Marquee --- */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg-deep);
  overflow: hidden;
  padding: 0.85rem 0;
}

.marquee-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: marquee 22s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.marquee-track span:nth-child(even) {
  color: var(--accent);
  opacity: 0.6;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --- Blocks --- */
.block {
  display: grid;
  grid-template-columns: minmax(0, 200px) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(4rem, 10vw, 7rem) var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

#about {
  padding-top: 1.5rem;
}

.block-label {
  position: sticky;
  top: 6rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.block-label .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.block-label .label {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lead {
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  max-width: 28ch;
}

.about-cols {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.about-cols p {
  color: var(--ink-soft);
  max-width: 42ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 200px;
}

.tags li {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition: border-color 0.25s, background 0.25s;
}

.tags li:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* --- Projects --- */
.projects {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

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

.project-link {
  display: block;
  padding: 1.75rem;
  position: relative;
  transition: background 0.35s var(--ease);
}

.project-link:hover {
  background: #fff;
}

.project-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.project h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.project-link:hover h3 {
  color: var(--accent);
}

.project p {
  color: var(--ink-soft);
  max-width: 40ch;
  font-size: 0.9375rem;
}

.project-arrow {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  font-size: 1.25rem;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.project-link:hover .project-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.project-muted .project-link {
  cursor: default;
}

.project-muted .project-link:hover {
  background: var(--bg);
}

.project-muted h3 {
  color: var(--ink-faint);
}

/* --- Contact --- */
.block-contact {
  border-bottom: none;
  padding-bottom: clamp(5rem, 12vw, 9rem);
}

.contact-heading {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.contact-heading em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.contact-sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 38ch;
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 2.5rem;
  transition: color 0.25s, border-color 0.25s;
}

.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.social a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: color 0.25s;
}

.social a:hover {
  color: var(--ink);
}

/* --- Footer --- */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    inset: 0;
    top: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: var(--bg);
    color: var(--ink);
    mix-blend-mode: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
  }

  .nav.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    font-size: 0.875rem;
  }

  .menu-btn {
    display: flex;
    z-index: 101;
    mix-blend-mode: difference;
    color: #fff;
  }

  .menu-btn[aria-expanded="true"] span:first-child {
    transform: translateY(4.5px) rotate(45deg);
  }

  .menu-btn[aria-expanded="true"] span:last-child {
    transform: translateY(-4.5px) rotate(-45deg);
  }

  .block {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .block-label {
    position: static;
    flex-direction: row;
    align-items: baseline;
    gap: 0.75rem;
  }

  .about-cols {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tags {
    max-width: none;
  }

  .hero-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .scroll-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .marquee-track,
  .scroll-line,
  .hero-meta .dot {
    animation: none;
  }

  .orb {
    transition: none;
  }
}
