/* ── Design Tokens ────────────────────────── */
:root {
  /* Colors */
  --color-heartwood: #1a1410;
  --color-bark: #3b2f20;
  --color-rimu-gold: #c8a96e;
  --color-sawdust-cream: #e8d5a8;
  --color-workshop-linen: #f5eedf;
  --color-koru-green: #2d5a3d;
  --color-paua-blue: #1b6b8a;
  --color-clay: #8c4a2f;
  --color-white: #faf8f4;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --content-max: 1100px;
  --content-padding: 1.5rem;
  --nav-height: 72px;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition: 0.3s var(--ease-out);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-heartwood);
  background-color: var(--color-workshop-linen);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-koru-green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-rimu-gold); }

/* ── Typography ────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-bark);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: var(--space-lg); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.35rem; margin-bottom: var(--space-sm); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* ── Utilities ────────────────────────── */
.content-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--alt {
  background-color: var(--color-sawdust-cream);
}

.section__title {
  text-align: center;
  position: relative;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--color-rimu-gold);
  border-radius: 2px;
}

.section__subtitle {
  text-align: center;
  color: var(--color-bark);
  opacity: 0.7;
  margin-bottom: var(--space-2xl);
  font-size: 1.1rem;
}

.section__cta {
  text-align: center;
  margin-top: var(--space-2xl);
}

/* ── Buttons ────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-koru-green);
  color: var(--color-white);
  border-color: var(--color-koru-green);
}
.btn--primary:hover {
  background: var(--color-bark);
  border-color: var(--color-bark);
  color: var(--color-rimu-gold);
}

.btn--outline {
  background: transparent;
  color: var(--color-koru-green);
  border-color: var(--color-koru-green);
}
.btn--outline:hover {
  background: var(--color-koru-green);
  color: var(--color-white);
}

/* ── Navigation ────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav--scrolled {
  background: rgba(245, 238, 223, 0.97);
  box-shadow: 0 2px 20px rgba(26, 20, 16, 0.08);
  backdrop-filter: blur(8px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-bark);
  z-index: 101;
}

.nav__logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.nav__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-bark);
}

.nav__links {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.nav__link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-bark);
  position: relative;
  padding: var(--space-xs) 0;
  text-decoration: none;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-rimu-gold);
  transition: width var(--transition);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__link:hover {
  color: var(--color-koru-green);
}

.nav__link--active {
  color: var(--color-koru-green);
}

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: 101;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-bark);
  transition: all var(--transition);
  border-radius: 1px;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .nav__toggle { display: flex; }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xl);
    background: var(--color-workshop-linen);
    transition: right var(--transition);
    box-shadow: -4px 0 30px rgba(26, 20, 16, 0.1);
  }

  .nav__links.open {
    right: 0;
  }

  .nav__link {
    font-size: 1.2rem;
  }
}

/* ── Hero ────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2a1f15;
}

.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(200, 169, 110, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(45, 90, 61, 0.1) 0%, transparent 50%);
}

/* Subtle wood-grain texture via SVG */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 20, 16, 0.3) 0%,
    rgba(26, 20, 16, 0.1) 40%,
    rgba(26, 20, 16, 0.5) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--color-workshop-linen);
  animation: fadeUp 1s var(--ease-out) both;
}

.hero__logo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto var(--space-xl);
  border: 3px solid rgba(200, 169, 110, 0.4);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--color-workshop-linen);
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
}

.hero__tagline {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--color-sawdust-cream);
  opacity: 0.9;
  margin-bottom: var(--space-2xl);
  font-weight: 400;
}

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

/* ── Gallery Grid ────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ── Project Card ────────────────────────── */
.project-card {
  display: block;
  background: var(--color-white);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(59, 47, 32, 0.08);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(26, 20, 16, 0.12);
  color: inherit;
}

.project-card:hover .project-card__image::after {
  opacity: 1;
}

.project-card__image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.project-card__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-koru-green);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-sawdust-cream) 0%, #d4c49a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card__icon {
  font-size: 3rem;
  opacity: 0.4;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.project-card:hover .project-card__image img {
  transform: scale(1.05);
}

.project-card__info {
  padding: var(--space-lg);
}

.project-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--color-bark);
  margin-bottom: var(--space-xs);
}

.project-card__category {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-koru-green);
  background: rgba(45, 90, 61, 0.08);
  padding: 0.2em 0.6em;
  border-radius: 3px;
}

.project-card__year {
  font-size: 0.8rem;
  color: var(--color-bark);
  opacity: 0.5;
  margin-left: var(--space-sm);
}

/* ── Project Detail ────────────────────────── */
.project-detail__hero {
  height: 40vh;
  min-height: 300px;
  overflow: hidden;
}

.project-detail__hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-bark) 0%, var(--color-heartwood) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-detail__hero-icon {
  font-size: 5rem;
  opacity: 0.3;
}

.project-detail__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-detail__content {
  padding: var(--space-3xl) 0;
}

.project-detail__title {
  margin-bottom: var(--space-xl);
}

.project-detail__meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--color-sawdust-cream);
  border-radius: 8px;
  margin-bottom: var(--space-2xl);
  border-left: 4px solid var(--color-rimu-gold);
}

.project-detail__meta-item dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-koru-green);
  margin-bottom: var(--space-xs);
}

.project-detail__meta-item dd {
  font-size: 0.95rem;
  color: var(--color-bark);
}

.project-detail__body {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: var(--space-2xl);
}

.project-detail__body p + p {
  margin-top: var(--space-md);
}

/* ── About Teaser (homepage) ────────────────────────── */
.about-teaser__inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-3xl);
  align-items: center;
}

.about-teaser__logo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  margin: 0 auto;
  border: 4px solid var(--color-rimu-gold);
  box-shadow: 0 8px 30px rgba(26, 20, 16, 0.1);
}

.about-teaser__img {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  border: 4px solid var(--color-rimu-gold);
  box-shadow: 0 8px 30px rgba(26, 20, 16, 0.1);
}

@media (max-width: 768px) {
  .about-teaser__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-teaser__image { order: -1; }
  .about-teaser__logo { width: 160px; height: 160px; }
}

/* ── About Page ────────────────────────── */
.about__hero {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.about__portrait {
  width: 100%;
  max-width: 500px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  border: 4px solid var(--color-rimu-gold);
  box-shadow: 0 8px 30px rgba(26, 20, 16, 0.15);
}

.about__lead {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--color-bark);
  margin-bottom: var(--space-xl);
}

.about__content h2 {
  margin-top: var(--space-2xl);
}

/* ── CTA Section ────────────────────────── */
.cta-section {
  background-color: var(--color-bark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  text-align: center;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26, 20, 16, 0.75);
}

.cta-section__inner {
  position: relative;
  z-index: 1;
}

.cta-section h2 {
  color: var(--color-workshop-linen);
}

.cta-section p {
  color: var(--color-sawdust-cream);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* ── Contact ────────────────────────── */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-3xl);
  margin-top: var(--space-xl);
}

.contact__details {
  margin-top: var(--space-xl);
}

.contact__detail {
  margin-bottom: var(--space-lg);
}

.contact__detail strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-koru-green);
  margin-bottom: var(--space-xs);
}

@media (max-width: 768px) {
  .contact__grid { grid-template-columns: 1fr; }
}

/* ── Contact Form ────────────────────────── */
.contact-form__field {
  display: block;
  margin-bottom: var(--space-lg);
}

.contact-form__field span {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-bark);
  margin-bottom: var(--space-sm);
}

.contact-form__field input,
.contact-form__field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-heartwood);
  background: var(--color-white);
  border: 2px solid rgba(59, 47, 32, 0.15);
  border-radius: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
  outline: none;
  border-color: var(--color-koru-green);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

.contact-form__field textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-form__submit {
  width: 100%;
}

/* ── Blog ────────────────────────── */
.blog-card {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid rgba(59, 47, 32, 0.1);
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card__title {
  margin-bottom: var(--space-xs);
}

.blog-card__title a {
  color: var(--color-bark);
  text-decoration: none;
}

.blog-card__title a:hover {
  color: var(--color-koru-green);
}

.blog-card__date {
  font-size: 0.85rem;
  color: var(--color-bark);
  opacity: 0.5;
}

/* ── Post ────────────────────────── */
.post {
  padding-top: calc(var(--nav-height) + var(--space-3xl));
  padding-bottom: var(--space-4xl);
}

.post__header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 2px solid var(--color-rimu-gold);
}

.post__title {
  margin-bottom: var(--space-sm);
}

.post__date {
  font-size: 0.9rem;
  color: var(--color-bark);
  opacity: 0.6;
}

.post__body {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: var(--space-2xl);
}

/* ── Page ────────────────────────── */
.page {
  padding-top: calc(var(--nav-height) + var(--space-3xl));
  padding-bottom: var(--space-4xl);
}

.page__intro {
  font-size: 1.1rem;
  color: var(--color-bark);
  opacity: 0.7;
  margin-bottom: var(--space-2xl);
}

/* ── Footer ────────────────────────── */
.footer {
  background: var(--color-heartwood);
  color: var(--color-sawdust-cream);
  padding: var(--space-3xl) 0;
}

.footer__inner {
  text-align: center;
}

.footer__logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  border: 2px solid rgba(200, 169, 110, 0.3);
}

.footer__tagline {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-rimu-gold);
  margin-bottom: var(--space-lg);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer__links a {
  color: var(--color-sawdust-cream);
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.footer__links a:hover {
  opacity: 1;
  color: var(--color-rimu-gold);
}

.footer__copyright {
  font-size: 0.8rem;
  opacity: 0.4;
}

/* ── Responsive adjustments ────────────────────────── */

/* Fade-in animation (progressive enhancement via JS) */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 560px) {
  :root {
    --content-padding: 1rem;
  }

  .hero__logo {
    width: 100px;
    height: 100px;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .footer__links {
    flex-direction: column;
    gap: var(--space-md);
  }
}
