/* ============================================
   PORTFOLIO — Warm Atelier
   ============================================ */

:root {
  /* Atelier palette */
  --bg:       #f1ebdf;
  --bg-2:     #ebe2d0;
  --ink:      #3a342a;
  --ink-soft: #6b6353;
  --rule:     #d9cfbc;

  /* Ribbon colors */
  --r1: #d8b6a1; /* clay */
  --r2: #c4cdb1; /* sage */
  --r3: #e9cfb9; /* butter */
  --r4: #b9a89a; /* taupe */
  --r5: #ead2cf; /* dusty rose */

  /* Typography */
  --display: 'Instrument Serif', Georgia, serif;
  --sans:    'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --maxw: 1240px;
}

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

html { scroll-behavior: smooth; }

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

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.22 0 0 0 0 0.20 0 0 0 0 0.16 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

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

/* ---- NAV ---- */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 56px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--display);
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 0.55; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s, color 0.25s;
}
.nav-contact:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ---- HERO ---- */
.hero {
  position: relative;
  padding: 40px 0 120px;
  min-height: 720px;
  overflow: hidden;
}

.hero-ribbons {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero-ribbons svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding-top: 120px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 56px;
  padding-right: 56px;
}

.hero-text .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-text .eyebrow .dot {
  width: 7px; height: 7px;
  background: var(--r1);
  border-radius: 50%;
}
.hero-text h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(54px, 6.6vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.hero-text h1 .accent {
  font-style: italic;
  color: var(--ink-soft);
}
.hero-text .lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 440px;
  margin-bottom: 36px;
}
.hero-text .meta {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--ink-soft);
}
.hero-text .meta div span {
  display: block;
  color: var(--ink);
  margin-top: 4px;
  font-size: 14px;
}

.hero-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  justify-self: end;
  width: 100%;
}
.hero-portrait .photo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 30px 80px -30px rgba(58, 52, 42, 0.35);
}
.hero-portrait .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-portrait .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--rule);
  animation: spin 60s linear infinite;
}
.hero-portrait .ring-label {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: spin 60s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---- ABOUT STRIP ---- */
.about {
  position: relative;
  padding: 60px 0 80px;
}

.about-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 56px;
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-label {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 8px;
}
.about-label::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--ink);
  margin-bottom: 14px;
}

.about-quote {
  font-family: var(--display);
  font-style: italic;
  font-size: 26px;
  line-height: 1.25;
  color: var(--ink);
}

.about-body p {
  font-size: 19px;
  line-height: 1.5;
}
.about-body p + p {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 17px;
}

/* ---- DIVIDER RIBBON ---- */
.divider-ribbon {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.divider-ribbon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- PROJECTS HEADER ---- */
.projects-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 56px 40px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.projects-header h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1;
}
.projects-header h2 em { font-style: italic; color: var(--ink-soft); }
.projects-count {
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- PROJECT CARDS ---- */
.project {
  position: relative;
  padding: 80px 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.project.visible {
  opacity: 1;
  transform: none;
}

.project-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 56px;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 60px;
  align-items: center;
}
.project.reverse .project-inner {
  grid-template-columns: 7fr 5fr;
}
.project.reverse .project-info { order: 2; }

.project-index {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.project-info h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin-bottom: 20px;
}
.project-info h3 em { font-style: italic; color: var(--ink-soft); }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-soft);
}

.project-info p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 28px;
  max-width: 460px;
}

.project-meta-row {
  display: flex;
  gap: 36px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.project-meta-row div span {
  display: block;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  margin-top: 4px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  transition: gap 0.25s ease;
}
.project-cta:hover { gap: 18px; }
.project-cta svg { width: 16px; height: 16px; }

.project-link-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.project-link-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.project-visual {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 30px 60px -28px rgba(58, 52, 42, 0.25);
}
.project-visual img {
  width: 100%;
  height: auto;
  display: block;
}
.vribbon {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* Between-project ribbons */
.between {
  position: relative;
  height: 160px;
  overflow: hidden;
}
.between svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- SKILLS ---- */
.skills {
  position: relative;
  padding: 120px 0 80px;
}

.skills-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 56px;
}

.skills h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 4.5vw, 56px);
  letter-spacing: -0.015em;
  margin-bottom: 60px;
  max-width: 800px;
  line-height: 1.05;
}
.skills h2 em { font-style: italic; color: var(--ink-soft); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  border-top: 1px solid var(--rule);
  padding-top: 40px;
}

.skills-col h4 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 18px;
  color: var(--ink);
}

.skills-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skills-col li {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---- FOOTER ---- */
.footer {
  position: relative;
  padding: 140px 0 60px;
  margin-top: 60px;
  overflow: hidden;
}

.footer-ribbons {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.footer-ribbons svg {
  width: 100%;
  height: 100%;
  display: block;
}

.footer-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 56px;
}

.footer h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(64px, 8vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin-bottom: 40px;
}
.footer h2 em { font-style: italic; color: var(--ink-soft); }

.footer-email {
  display: inline-block;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  margin-bottom: 80px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
}

.footer-socials {
  display: flex;
  gap: 24px;
}
.footer-socials a {
  color: var(--ink);
  text-decoration: none;
}
.footer-socials a:hover { opacity: 0.6; }

/* Case study footer — compact, no ribbons */
.cs-footer {
  padding: 40px 0;
  margin-top: 0;
}
.cs-footer .footer-bottom {
  border-top: none;
}

/* ---- SCROLL FADE (for projects) ---- */
.cs-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.cs-fade.visible {
  opacity: 1;
  transform: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 920px) {
  .hero-grid,
  .about-inner,
  .project-inner,
  .project.reverse .project-inner,
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .projects-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .nav-links { display: none; }

  .hero-portrait {
    max-width: 280px;
    justify-self: center;
  }

  .hero-grid {
    padding-top: 60px;
  }

  .project.reverse .project-info { order: 0; }

  .nav,
  .hero-grid,
  .about-inner,
  .project-inner,
  .project.reverse .project-inner,
  .skills-inner,
  .footer-inner,
  .projects-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .footer { padding: 80px 0 40px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-portrait .ring,
  .hero-portrait .ring-label {
    animation: none;
  }
}

/* ---- LIGHTBOX ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}

.project-visual img,
.cs-cover-img,
.cs-img-full img,
.cs-img-grid img,
.cs-annotated-img {
  cursor: zoom-in;
}
