/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #f5f0eb;
  --bg-alt: #ede8e2;
  --ink: #1a1612;
  --ink-2: #6b635c;
  --ink-3: #a09890;
  --accent: #c4613a;
  --white: #faf8f5;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius: 4px;
  --radius-lg: 14px;

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

  --container: 1080px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

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

/* ============================================
   SHARED TYPOGRAPHY
   ============================================ */
.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  transition: background 0.35s var(--ease-out), border-color 0.35s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(245, 240, 235, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(26, 22, 18, 0.07);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  transition: color 0.2s;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.25rem;
}

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
  transform-origin: center;
}

.nav-toggle.open span:first-child { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:last-child { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 62px 0 0 0;
  background: var(--bg);
  z-index: 199;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.nav-mobile.open { display: flex; }

.nav-mobile-link {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  transition: color 0.2s;
}

.nav-mobile-link:hover { color: var(--accent); }

/* ============================================
   BUTTON
   ============================================ */
.btn {
  display: inline-block;
  padding: 0.8rem 1.875rem;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 97, 58, 0.3);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 0.875rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px clamp(1.5rem, 5vw, 3.5rem) 80px;
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.15s forwards;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 10rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease-out) 0.35s forwards;
}

.hero-name em {
  font-style: italic;
  font-weight: 200;
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--ink-2);
  max-width: 440px;
  margin-bottom: 2.75rem;
  font-weight: 300;
  line-height: 1.65;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease-out) 0.55s forwards;
}

.hero .btn {
  opacity: 0;
  animation: fadeUp 0.9s var(--ease-out) 0.72s forwards;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: clamp(1.5rem, 5vw, 3.5rem);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  opacity: 0;
  animation: fadeIn 1s ease 1.1s forwards;
}

.hero-scroll-hint span {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.scroll-line {
  width: 44px;
  height: 1px;
  background: rgba(160, 152, 144, 0.3);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scanLine 2.2s ease-in-out 1.3s infinite;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
  padding: 130px 0;
  background: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 3rem 4rem;
  align-items: start;
}

.about-sidebar {
  padding-top: 0.5rem;
}

.about-sidebar .section-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: block;
}

.about-content .section-heading {
  margin: 0 0 1.5rem;
}

.about-content p {
  color: var(--ink-2);
  font-size: 1.0625rem;
  margin-bottom: 1.25rem;
  max-width: 560px;
  font-weight: 300;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 2rem;
}

.skill-item {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(26, 22, 18, 0.14);
  border-radius: 100px;
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  cursor: default;
}

.skill-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(196, 97, 58, 0.04);
}

/* ============================================
   PROJECTS
   ============================================ */
.projects {
  padding: 130px 0;
}

.section-header {
  margin-bottom: 3rem;
}

.section-header .section-label {
  display: block;
  margin-bottom: 0.625rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.project-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 24px 56px rgba(26, 22, 18, 0.1);
}

.project-image {
  height: 200px;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out);
}

.project-card:hover .project-image {
  transform: scale(1.04);
}

.project-info {
  padding: 1.5rem 1.625rem 1.75rem;
}

.project-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0.3rem 0 0.6rem;
  color: var(--ink);
}

.project-desc {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

.project-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}

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

/* ============================================
   CONTACT
   ============================================ */
.contact {
  padding: 130px 0;
  background: var(--ink);
}

.contact-inner {
  text-align: center;
}

.contact .section-label {
  display: block;
  color: rgba(250, 248, 245, 0.35);
  margin-bottom: 1.5rem;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  color: var(--white);
  line-height: 1.0;
  margin-bottom: 1.25rem;
}

.contact-heading em {
  font-style: italic;
  font-weight: 200;
}

.contact-sub {
  font-size: 1.0625rem;
  color: rgba(250, 248, 245, 0.5);
  margin-bottom: 2.75rem;
  font-weight: 300;
}

.contact .btn {
  background: var(--white);
  color: var(--ink);
}

.contact .btn:hover {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 8px 28px rgba(196, 97, 58, 0.4);
}

.social-links {
  display: flex;
  gap: 2.25rem;
  justify-content: center;
  margin-top: 3.5rem;
}

.social-link {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 248, 245, 0.35);
  transition: color 0.2s;
  position: relative;
}

.social-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: rgba(250, 248, 245, 0.5);
  transition: width 0.3s var(--ease-out);
}

.social-link:hover { color: var(--white); }
.social-link:hover::after { width: 100%; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 1.375rem 0;
  background: #100d0b;
  text-align: center;
}

.footer p {
  font-size: 0.78rem;
  color: rgba(250, 248, 245, 0.2);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-out) var(--delay, 0s),
              transform 0.75s var(--ease-out) var(--delay, 0s);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scanLine {
  0%   { left: -100%; }
  50%  { left: 0%; }
  100% { left: 100%; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

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

  .about-sidebar .section-label {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-name { line-height: 0.9; }
  .social-links { gap: 1.5rem; }
}
