/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  /* Surfaces */
  --background:         158 35% 8%;
  --card:               158 30% 11%;
  --muted:              158 20% 16%;
  --border:             158 18% 20%;

  /* Text */
  --foreground:         60 25% 92%;
  --muted-foreground:   95 12% 62%;

  /* Accents */
  --primary:            33 92% 44%;
  --primary-foreground: 60 25% 96%;
  --secondary:          95 15% 58%;
  --accent:             95 15% 58%;

  /* Typography */
  --font-heading: 'Cormorant Garamond', ui-serif, Georgia, serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --radius: .25rem;

  /* Layout */
  --gutter:       8%;
  --section-pad:  8rem;
}

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

html { scroll-behavior: smooth; }

html {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) hsl(var(--background));
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--background)); }
::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--accent)); }

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.02em;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ============================================================
   Utilities
   ============================================================ */
.label {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .125em;
  text-transform: uppercase;
  line-height: 1.4;
}

.container { padding-inline: var(--gutter); }

.accent { color: hsl(var(--accent)); }

.serif-italic { font-style: italic; font-weight: 500; }

.section { padding-block: var(--section-pad); }
.section--gallery .section__head { margin-bottom: 4rem; }

.section__head { display: flex; flex-direction: column; gap: 2rem; margin-bottom: 5rem; }
.section__title { font-size: clamp(2.5rem, 6vw, 3.75rem); max-width: 36rem; }
.section__lead { max-width: 24rem; color: hsl(var(--foreground) / .7); }

@media (min-width: 768px) {
  .section__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .125em;
  text-transform: uppercase;
  padding: 1rem 1.75rem;
  transition: all .25s;
}

.btn--primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn--primary:hover { filter: brightness(1.1); }

.btn--inverse {
  background: hsl(var(--primary-foreground));
  color: hsl(var(--primary));
  margin-top: 2.5rem;
}
.btn--inverse:hover {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  border-bottom: 1px solid transparent;
  transition: background .5s, border-color .5s;
}
.nav.is-scrolled {
  background: hsl(var(--background) / .85);
  backdrop-filter: blur(12px);
  border-bottom-color: hsl(var(--border));
}

.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.25rem;
}

.nav__brand { display: flex; align-items: center; gap: .75rem; }
.nav__brand-mark { color: hsl(var(--secondary)); }
.nav__brand-name { font-family: var(--font-heading); font-size: 1.25rem; letter-spacing: -.02em; }

.nav__links { display: none; align-items: center; gap: 2.5rem; }
.nav__cta { padding: .625rem 1.25rem; }

.nav__link { position: relative; color: hsl(var(--foreground) / .7); transition: color .25s; }
.nav__link:hover { color: hsl(var(--foreground)); }
.nav__link::after {
  content: ''; position: absolute; left: 0; bottom: -.25rem;
  height: 2px; width: 0;
  background: hsl(var(--accent));
  transition: width .3s ease;
}
.nav__link:hover::after { width: 100%; }

.nav__toggle { display: block; width: 1.5rem; height: 1.5rem; position: relative; }
.nav__toggle span {
  position: absolute; left: 0; right: 0; height: 2px;
  background: hsl(var(--foreground)); transition: .3s;
}
.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav__toggle span:nth-child(3) { bottom: 0; }

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

@media (max-width: 767px) {
  .nav__links.is-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem;
    position: absolute; top: 100%; left: 0; right: 0;
    padding: 1.5rem var(--gutter);
    background: hsl(var(--background) / .95);
    backdrop-filter: blur(12px);
    border-top: 1px solid hsl(var(--border));
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: hsl(var(--background));
}

.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: .7;
}

.hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    hsl(var(--background)) 0%,
    hsl(var(--background) / .4) 45%,
    hsl(var(--background) / .3) 100%);
}

.grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 50% 50%,
    hsl(158 20% 16% / .4), transparent 70%);
}

.hero__guide { position: absolute; top: 0; bottom: 0; width: 1px; background: hsl(var(--foreground) / .1); }
.hero__guide--l { left: var(--gutter); }
.hero__guide--r { right: var(--gutter); }

.hero__content {
  position: relative; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding-block: 7rem;
}

.hero__line {
  font-size: 14vw;
  line-height: .9;
  letter-spacing: -.02em;
}

.hero__top { max-width: 42rem; }
.hero__top .label { margin-bottom: 1.5rem; }

.hero__bottom { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.hero__tagline { margin-top: 1.5rem; max-width: 20rem; color: hsl(var(--foreground) / .6); }

.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.hero__scroll .label { color: hsl(var(--foreground) / .4); }
.hero__scroll-line {
  width: 1px; height: 2.5rem;
  background: hsl(var(--foreground) / .3);
  animation: pulse 2s ease-in-out infinite;
}

@media (min-width: 768px) {
  .hero__line { font-size: 7vw; }
}

/* ============================================================
   Services
   ============================================================ */
.services__eyebrow { margin-bottom: 1.25rem; }

.blueprint {
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

.blueprint__row {
  display: grid; grid-template-columns: 1fr;
  gap: 2rem; padding-block: 3rem;
  align-items: center;
  border-bottom: 1px solid hsl(var(--border));
  transition: background .3s;
}
.blueprint__row:last-child { border-bottom: none; }
.blueprint__row:hover { background: hsl(var(--muted) / .3); }

.blueprint__name { font-size: clamp(1.875rem, 4vw, 2.25rem); }
.blueprint__body p { color: hsl(var(--foreground) / .7); }

.blueprint__tags {
  display: flex; flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-top: 1.25rem;
}
.blueprint__tags .label { color: hsl(var(--foreground) / .5); }

.blueprint__figure { overflow: hidden; aspect-ratio: 4/3; }
.blueprint__figure img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s ease;
}
.blueprint__row:hover .blueprint__figure img { transform: scale(1.05); }

@media (min-width: 768px) {
  .blueprint__row { grid-template-columns: repeat(12, 1fr); }
  .blueprint__no     { grid-column: span 1; }
  .blueprint__name   { grid-column: span 3; }
  .blueprint__body   { grid-column: span 4; }
  .blueprint__figure { grid-column: span 4; }
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery__eyebrow { margin-bottom: 1.25rem; }

.gallery__track-wrap {
  display: grid;
  grid-template-columns: var(--gutter) 1fr var(--gutter);
  align-items: center;
}

.gallery__arrow--prev {
  display: grid;
  place-items: center;
  justify-self: end;
  margin-right: .5rem;
}
.gallery__arrow--next {
  display: grid;
  place-items: center;
  justify-self: start;
  margin-left: 1.25rem;
}

.gallery__track {
  display: flex; gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline-start: 0;
  padding-bottom: 1rem;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }

.gallery__card { flex: 0 0 85vw; scroll-snap-align: start; }

.gallery__figure { overflow: hidden; aspect-ratio: 4/3; margin-bottom: 1.25rem; }
.gallery__figure img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s;
}
.gallery__card:hover .gallery__figure img { transform: scale(1.05); }

.gallery__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.gallery__meta h3 { font-size: 1.5rem; }
.gallery__note { margin-top: .5rem; color: hsl(var(--foreground) / .5); }

@media (min-width: 640px)  { .gallery__card { flex-basis: 60vw; } }
@media (min-width: 768px)  { .gallery__card { flex-basis: 42vw; } }
@media (min-width: 1024px) { .gallery__card { flex-basis: 34vw; } }

.icon-btn {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground) / .7);
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: hsl(var(--accent)); color: hsl(var(--accent)); }

/* ============================================================
   Craft
   ============================================================ */
.craft {
  display: grid; grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}

.craft__text  { order: 2; }
.craft__figure { order: 1; overflow: hidden; aspect-ratio: 4/5; }
.craft__figure img { width: 100%; height: 100%; object-fit: cover; }

.craft__eyebrow { margin-bottom: 1.25rem; }
.craft__title   { margin-bottom: 2rem; }

.craft__body { color: hsl(var(--foreground) / .7); margin-bottom: 1.5rem; }
.craft__body--last { margin-bottom: 2.5rem; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}
.stats__value {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3rem);
  color: hsl(var(--accent));
  line-height: 1;
}
.stats__label { margin-top: .5rem; color: hsl(var(--foreground) / .5); }

@media (min-width: 768px) {
  .craft { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .craft__text   { order: 1; }
  .craft__figure { order: 2; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.footer__inner { padding-block: 6rem; }

.footer__grid {
  display: grid; grid-template-columns: 1fr;
  gap: 4rem; margin-bottom: 5rem;
}

.footer__eyebrow { opacity: .7; margin-bottom: 1.5rem; }

.footer__title {
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: .95;
}

.footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.footer__col-head { opacity: .6; margin-bottom: 1rem; }

.footer__cols a,
.footer__cols p { display: block; font-size: 1.125rem; }

.footer__cols a { transition: color .2s; }
.footer__cols a:hover { color: hsl(var(--background)); }

.footer__email { overflow-wrap: anywhere; }

.footer__hours { opacity: .8; }

.footer__base {
  display: flex; flex-direction: column; gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--primary-foreground) / .2);
}

.footer__brand { display: flex; align-items: center; gap: .75rem; }
.footer__brand-name { font-family: var(--font-heading); font-size: 1.25rem; }

.footer__copyright { opacity: .6; }

@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .footer__cols { align-items: end; }
  .footer__base { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ============================================================
   Estimate Panel
   ============================================================ */
.panel { position: fixed; inset: 0; z-index: 50; display: none; }
.panel.is-open { display: block; }

.panel__scrim {
  position: absolute; inset: 0;
  background: hsl(var(--background) / .8);
  backdrop-filter: blur(4px);
}

.panel__sheet {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 36rem;
  background: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
  overflow-y: auto;
  animation: slideIn .5s ease;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) transparent;
}
.panel__sheet::-webkit-scrollbar { width: 4px; }
.panel__sheet::-webkit-scrollbar-track { background: transparent; }
.panel__sheet::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 0;
}
.panel__sheet::-webkit-scrollbar-thumb:hover { background: hsl(var(--accent)); }
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.panel__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 2rem;
  background: hsl(var(--card) / .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
}
.panel__title { font-size: 1.5rem; }

.panel__close {
  font-size: 1.75rem; line-height: 1;
  color: hsl(var(--foreground) / .6);
  transition: color .2s;
}
.panel__close:hover { color: hsl(var(--foreground)); }

.panel__form {
  padding: 2rem;
  display: flex; flex-direction: column;
  gap: 2.5rem;
}

.panel__label {
  display: block; margin-bottom: 1rem;
  color: hsl(var(--foreground) / .6);
}
.panel__group { border: none; }

.panel__form input[type=range] {
  width: 100%;
  accent-color: hsl(var(--primary));
}

/* Chips */
.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.chip-row  { display: flex; flex-wrap: wrap; gap: .75rem; }

.chip { display: block; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: block; text-align: center;
  padding: .75rem;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground) / .6);
  transition: all .2s; cursor: pointer;
}
.chip:hover span { border-color: hsl(var(--foreground) / .3); }

.chip input:checked + span {
  border-color: hsl(var(--accent));
  background: hsl(var(--accent) / .1);
  color: hsl(var(--accent));
}
.chip input:focus-visible + span { outline: 2px solid hsl(var(--primary)); }

.chip-row span { padding: .625rem 1rem; }

/* Price */
.panel__price-block {
  border-top: 1px solid hsl(var(--border));
  padding-top: 2rem;
}

.panel__price {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 2rem;
}
.panel__price-label { color: hsl(var(--foreground) / .6); }
.panel__price-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: hsl(var(--accent));
  line-height: 1;
}

/* Inputs */
.fields { display: flex; flex-direction: column; gap: 1rem; }

.panel__field { display: flex; flex-direction: column; gap: .35rem; }
.panel__field-label {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / .5);
}
.req { color: #e08585; margin-left: .15em; }

.panel__form input[type=text],
.panel__form input[type=email],
.panel__form input[type=tel] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid hsl(var(--border));
  padding: .75rem 0;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color .2s;
}
.panel__form input::placeholder { color: hsl(var(--foreground) / .4); }
.panel__form input:focus { border-bottom-color: hsl(var(--accent)); }

.panel__error { color: #e08585; font-size: .875rem; }

.panel__submit { width: 100%; margin-top: 2rem; padding: 1rem; }
.panel__fine {
  margin-top: 1rem;
  text-align: center;
  color: hsl(var(--foreground) / .4);
}

/* Success */
.panel__success { padding: 5rem 2rem; text-align: center; }
.panel__success-eyebrow { margin-bottom: 1.5rem; }
.panel__success-title { font-size: 2.25rem; margin-bottom: 1.5rem; }
.panel__success-body {
  max-width: 24rem; margin: 0 auto 2.5rem;
  color: hsl(var(--foreground) / .7);
}

/* Floating button */
.estimate-fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 30;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: .75rem 1.25rem;
  box-shadow: 0 10px 15px -3px hsl(var(--background) / .5),
              0 4px 6px -4px hsl(var(--background) / .5);
  transition: filter .2s;
}
.estimate-fab:hover { filter: brightness(1.1); }
