@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #F0EDDC;
  --panel: #E8E1CB;
  --panel-2: #DED3B6;
  --ink: #4A3B2E;
  --ink-soft: #6B5844;
  --accent: #DFA0AA;
  --accent-dark: #C77E8C;
  --stone: #B9AC8C;
  --stone-bg: #EDE8D9;
  --coffee: #845F4A;
  --coffee-bg: #E8DDD2;
  --muted: #9C8F76;
  --line: #D9CFB2;
  --pink-bg: #F5E3E6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--coffee); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
p { margin: 0; }
.italic { font-style: italic; font-weight: 500; }

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem clamp(1.5rem, 5vw, 4rem);
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.nav-name {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.nav-logo { height: 40px; width: auto; display: block; }
.nav-links { display: flex; gap: clamp(1.25rem, 3vw, 2.25rem); font-size: 0.92rem; align-items: center; }
.nav-links a { color: var(--ink-soft); font-weight: 500; padding: 0.4rem 0.1rem; }
.nav-links a:hover { color: var(--coffee); text-decoration: none; }
.nav-links a.active { color: var(--accent-dark); border-bottom: 2px solid var(--accent-dark); }

/* ---------- hero: clean, text only, no images ---------- */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 5vw, 4rem);
  text-align: left;
}
.hero-tag {
  display: inline-block;
  color: var(--coffee);
  background: var(--coffee-bg);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
}
.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  max-width: 20ch;
  color: var(--ink);
}
.hero-title .hl { color: var(--accent-dark); font-style: italic; font-weight: 500; }
.hero-sub {
  margin-top: 1.5rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.65;
}
.hero-cta { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 30px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 2px solid var(--coffee);
  color: var(--coffee);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--coffee); color: var(--bg); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ---------- section wrappers ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem); }
.section-band { padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2.25rem;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
.section-head .see-all { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.section-inner { max-width: 1200px; margin: 0 auto; }

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

.pcard {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pcard:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 16px 32px rgba(74, 59, 46, 0.12); }

.pcard-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pcard-image img { width: 100%; height: 100%; object-fit: contain; }
.pcard-body { padding: 1.4rem 1.5rem 1.6rem; }
.pcard-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 0.65rem; display: inline-block; color: var(--accent-dark); }
.pcard h3 { font-size: 1.18rem; margin-bottom: 0.55rem; color: var(--ink); font-weight: 600; }
.pcard p { font-size: 0.88rem; color: var(--muted); line-height: 1.55; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem clamp(1.5rem, 5vw, 4rem);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer a { color: var(--coffee); }

/* ================= PROJECT DETAIL PAGE ================= */
.proj-hero-band { padding: clamp(2rem, 5vw, 3.5rem) 0 0; }
.proj-hero { padding: 0 clamp(1.5rem, 5vw, 4rem); max-width: 1200px; margin: 0 auto; }
.proj-back { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 2rem; display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.proj-back:hover { color: var(--coffee); }

.proj-tag {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  background: var(--coffee-bg);
  color: var(--coffee);
}
.proj-title { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 26ch; margin-bottom: 1.5rem; }

.proj-meta {
  display: flex;
  gap: 2.25rem;
  flex-wrap: wrap;
  margin: 2rem 0 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.proj-meta div { font-size: 0.88rem; }
.proj-meta .label { color: var(--muted); margin-bottom: 0.3rem; font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }
.proj-meta .value { color: var(--ink); font-weight: 500; }

/* hero image: fit properly, no forced crop */
.proj-hero-image {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 3.5rem;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 560px;
}
.proj-hero-image img { width: 100%; height: auto; max-height: 560px; object-fit: contain; }

.proj-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem) 5rem;
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.proj-toc { font-size: 0.9rem; position: sticky; top: 2rem; align-self: start; }
.proj-toc-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; }
.proj-toc a { display: block; color: var(--ink-soft); padding: 0.5rem 0; border-left: 3px solid transparent; padding-left: 0.9rem; font-weight: 500; }
.proj-toc a:hover { color: var(--coffee); text-decoration: none; border-left-color: var(--accent); }

.proj-content h2 { font-size: 1.6rem; margin: 3.25rem 0 1.1rem; }
.proj-content h2:first-child { margin-top: 0; }
.proj-content h3 { font-size: 1.2rem; margin: 2.5rem 0 1rem; }
.proj-content p { font-size: 1.02rem; color: var(--ink-soft); margin-bottom: 1.3rem; max-width: 70ch; line-height: 1.75; }
.proj-content ul { margin: 0 0 1.3rem; padding-left: 1.4rem; color: var(--ink-soft); }
.proj-content li { margin-bottom: 0.55rem; line-height: 1.65; }

/* gallery: fit each image by its own shape, never force-crop */
.proj-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin: 1.75rem 0 2.25rem; align-items: start; }
.proj-gallery figure {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 6px 16px rgba(74,59,46,0.08);
  display: flex;
  flex-direction: column;
}
.proj-gallery .img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  min-height: 160px;
}
.proj-gallery img { width: 100%; height: auto; display: block; }
.proj-gallery figcaption { font-size: 0.8rem; color: var(--muted); padding: 0.7rem 0.9rem; background: #fff; border-top: 1px solid var(--line); }
.proj-gallery.full { grid-template-columns: 1fr; }
.proj-gallery.three { grid-template-columns: repeat(3, 1fr); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.75rem 0 2.25rem; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 1.15rem 1.25rem; }
.stat .num { font-family: 'Fraunces', serif; font-size: 1.6rem; color: var(--ink); font-weight: 600; }
.stat .label { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

.cite-box {
  background: var(--panel-2);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 1.75rem 0 2.25rem;
  line-height: 1.65;
}
.cite-box a { font-size: 0.87rem; font-weight: 600; }

.callout { background: var(--stone-bg); border-radius: 12px; padding: 1.5rem 1.75rem; margin: 1.75rem 0 2.25rem; }
.callout p { color: var(--ink-soft); margin-bottom: 0; }
.callout.pink { background: var(--pink-bg); }

/* ---------- patent page blocks ---------- */
.patent-block { border-radius: 16px; padding: clamp(1.75rem, 4vw, 3rem); margin-bottom: 2.5rem; }
.patent-block h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0.9rem 0 1.4rem; max-width: 34ch; }
.patent-block h3 { font-size: 1.2rem; margin: 2.5rem 0 1rem; font-family: 'Fraunces', serif; }
.patent-block p { color: var(--ink-soft); max-width: 70ch; line-height: 1.75; margin-bottom: 1.2rem; }

/* ---------- about page ---------- */
.about-hero { max-width: 800px; margin: 0 auto; padding: 1rem clamp(1.5rem, 5vw, 4rem) 0; }
.about-wrap { max-width: 700px; margin: 0 auto; padding: 0 clamp(1.5rem, 5vw, 4rem) 5rem; }
.about-statement p { font-size: 1.15rem; line-height: 1.8; color: var(--ink-soft); margin-bottom: 1.6rem; max-width: 62ch; }

.contact-block { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.contact-block h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.contact-block .contact-row { font-size: 1.05rem; color: var(--ink-soft); line-height: 1.9; }
.contact-block a { font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .proj-body { grid-template-columns: 1fr; }
  .proj-toc { display: none; }
  .proj-gallery, .proj-gallery.three { grid-template-columns: 1fr; }
}
