/* ============================================================
   My Fairytale House — enchanted editorial
   Parchment + ink + ember. Fraunces display, Schibsted body.
   ============================================================ */

:root {
  --paper: #f7f1e5;
  --paper-deep: #efe5d1;
  --ink: #221b12;
  --ink-soft: #6a5f4d;
  --ember: #c14d24;
  --ember-deep: #98381a;
  --moss: #5f6f50;
  --night: #1b1510;
  --night-soft: #2a221a;
  --cream-on-night: #f3ead9;
  --line: rgba(34, 27, 18, 0.16);
  --line-light: rgba(243, 234, 217, 0.2);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Avenir Next", "Helvetica Neue", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --arch: 999px 999px 18px 18px;
  --container: 1200px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: clip;
}

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; height: auto; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: top 150ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

::selection { background: var(--ember); color: var(--paper); }

/* ============ type ============ */

.section-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-variation-settings: "opsz" 110;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 14px 0 0;
}
.section-title em {
  font-style: italic;
  font-weight: 480;
  color: var(--ember);
}

.chapter {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-soft);
}
.chapter::after {
  content: "";
  height: 1px;
  width: 64px;
  background: var(--line);
}
.chapter-no {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  letter-spacing: 0.04em;
}
.chapter-light { color: rgba(243, 234, 217, 0.65); }
.chapter-light::after { background: var(--line-light); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

/* ============ buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  padding: 16px 26px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms var(--ease-spring), background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 180ms ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ember);
  color: #fff7ec;
  box-shadow: 0 10px 24px -12px rgba(193, 77, 36, 0.55);
}
.btn-primary:hover {
  background: var(--ember-deep);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(152, 56, 26, 0.55);
}

.btn-ghost {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.btn-whatsapp {
  background: transparent;
  color: var(--cream-on-night);
  border-color: var(--line-light);
}
.btn-whatsapp:hover { border-color: var(--cream-on-night); transform: translateY(-2px); }

:is(a, button):focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============ header ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 241, 229, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.wordmark-door { width: 30px; height: 30px; color: var(--ember); flex: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  position: relative;
}
.site-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -5px;
  height: 1.5px;
  background: var(--ember);
  transition: right 220ms var(--ease-out);
}
.site-nav a:not(.nav-cta):hover::after { right: 0; }

.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 150ms ease, transform 180ms var(--ease-spring);
}
.nav-cta:hover { background: var(--ember); transform: translateY(-1px); }
.nav-cta-mobile { display: none; font-size: 14px; text-decoration: none; }

@media (max-width: 720px) {
  .site-nav { display: none; }
  .nav-cta-mobile { display: inline-flex; }
}

/* ============ hero ============ */

.hero { padding: clamp(28px, 6vh, 72px) 0 clamp(56px, 9vh, 120px); }

.hero-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 580;
  font-variation-settings: "opsz" 144;
  font-size: clamp(48px, 8.6vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 26px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  /* room for descenders inside the clip, pulled back so line spacing stays tight */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.hero-title .line > span {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 900ms var(--ease-out) forwards;
}
.hero-title .line:nth-child(1) > span { animation-delay: 80ms; }
.hero-title .line:nth-child(2) > span { animation-delay: 180ms; }
.hero-title .line:nth-child(3) > span { animation-delay: 280ms; }
.hero-title .line:nth-child(4) > span { animation-delay: 380ms; }

@keyframes rise { to { transform: translateY(0); } }

.accent-italic {
  font-style: italic;
  font-weight: 470;
  color: var(--ember);
}

.hero-sub {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 0 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-arch { position: relative; }

.arch {
  margin: 0;
  border-radius: var(--arch);
  overflow: hidden;
  background: var(--paper-deep);
}
.arch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arch-hero {
  aspect-ratio: 4 / 5;
  box-shadow: 0 32px 64px -32px rgba(34, 27, 18, 0.45);
}
.arch-hero img {
  transform-origin: 50% 70%;
}

.spark {
  position: absolute;
  width: 22px;
  fill: var(--ember);
  opacity: 0;
  animation: spark-in 700ms var(--ease-out) forwards, twinkle 3.4s ease-in-out 1.4s infinite;
}
.spark-1 { top: 4%; left: -34px; animation-delay: 700ms, 1.4s; }
.spark-2 { bottom: 12%; right: -30px; width: 15px; animation-delay: 950ms, 2.2s; }

@keyframes spark-in { to { opacity: 1; } }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.72) rotate(18deg); opacity: 0.55; }
}

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-arch { order: -1; padding-inline: 6vw; }
  .arch-hero { aspect-ratio: 4 / 4.4; }
  .spark-1 { left: 2vw; }
  .spark-2 { right: 2vw; }
  .hero-title { margin-top: 8px; }
}

/* ============ story ============ */

.story { padding: clamp(64px, 11vh, 140px) 0; }

.story-body {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 62ch;
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.65;
  color: var(--ink-soft);
}
.story-body .dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.4em;
  line-height: 0.8;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--ember);
}

/* ============ gallery ============ */

.gallery {
  background: var(--paper-deep);
  padding: clamp(64px, 11vh, 140px) 0 clamp(56px, 9vh, 110px);
  border-block: 1px solid var(--line);
}

.gallery-head { position: relative; }

.gallery-lede {
  margin: 18px 0 0;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.gallery-hint {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ember);
  white-space: nowrap;
}

.strip-wrap { margin-top: clamp(28px, 5vh, 52px); }

.strip {
  list-style: none;
  margin: 0;
  padding: 8px clamp(20px, 5vw, 48px) 20px;
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.4vw, 28px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.dragging .strip-btn { pointer-events: none; }

.strip-item {
  flex: none;
  scroll-snap-align: center;
  width: min(72vw, 380px);
}
.strip-item.shape-tall  { width: min(60vw, 300px); }
.strip-item.shape-wide  { width: min(80vw, 470px); }

.strip-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper);
  overflow: hidden;
  cursor: pointer;
  border-radius: 22px;
}
.shape-arch .strip-btn { border-radius: var(--arch); }
.shape-tall .strip-btn { border-radius: 22px 22px 160px 160px / 22px 22px 90px 90px; }

.strip-btn img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 600ms var(--ease-out), filter 600ms ease;
}
.shape-arch .strip-btn img, .shape-tall .strip-btn img { aspect-ratio: 3 / 3.8; }

@media (hover: hover) {
  .strip-btn:hover img { transform: scale(1.06); }
}

.strip-caption {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}
.strip-caption i {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ember);
  margin-right: 6px;
}

/* entrance: items rise as they enter the viewport */
.strip-item { opacity: 0; transform: translateY(28px); transition: opacity 700ms ease, transform 700ms var(--ease-out); }
.strip-item.in { opacity: 1; transform: none; }

.strip-progress {
  margin: 18px clamp(20px, 5vw, 48px) 0;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
#strip-bar {
  display: block;
  height: 100%;
  width: 12%;
  background: var(--ember);
  border-radius: 2px;
  transition: width 80ms linear;
}

.gallery-close {
  margin-top: clamp(40px, 7vh, 64px);
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.gallery-tease {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  margin: 0;
}

/* ============ craft ============ */

.craft { padding: clamp(64px, 11vh, 140px) 0; }

.craft-lede {
  margin: clamp(22px, 3vw, 34px) 0 0;
  max-width: 52ch;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft);
}

.craft-list {
  list-style: none;
  margin: clamp(36px, 6vh, 64px) 0 0;
  padding: 0;
}
.craft-row {
  display: grid;
  grid-template-columns: 72px 1fr 1.2fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: baseline;
  padding: clamp(22px, 3.4vh, 34px) 0;
  border-top: 1px solid var(--line);
}
.craft-row:last-child { border-bottom: 1px solid var(--line); }

.craft-no {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ember);
}
.craft-row h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(20px, 2.6vw, 27px);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.craft-row p { margin: 0; color: var(--ink-soft); }

@media (max-width: 720px) {
  .craft-row { grid-template-columns: 44px 1fr; }
  .craft-row p { grid-column: 2; }
}

/* ============ how ============ */

.how {
  background: var(--paper-deep);
  border-block: 1px solid var(--line);
  padding: clamp(64px, 11vh, 140px) 0;
}

.steps {
  list-style: none;
  margin: clamp(36px, 6vh, 60px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 36px);
  counter-reset: step;
}
.step { position: relative; padding-top: 18px; }
.step::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.step-no {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 34px;
  color: var(--ember);
  line-height: 1;
}
.step h3 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.step p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }

@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }

.delivery {
  margin: clamp(44px, 8vh, 72px) auto 0;
  max-width: 880px;
}
.delivery img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--arch);
}
.delivery figcaption {
  text-align: center;
  margin-top: 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
}

/* ============ uses ============ */

.uses { padding: clamp(64px, 11vh, 140px) 0; }

.uses-grid {
  list-style: none;
  margin: clamp(36px, 6vh, 60px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.4vw, 26px);
}
.use-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(24px, 3.4vw, 38px);
  background: var(--paper);
  transition: transform 250ms var(--ease-out), box-shadow 250ms ease, border-color 200ms ease;
}
.use-card:nth-child(1) { border-radius: var(--arch); }
.use-card:nth-child(4) { border-radius: 22px 22px 160px 22px; }
@media (hover: hover) {
  .use-card:hover {
    transform: translateY(-5px);
    border-color: var(--ember);
    box-shadow: 0 22px 44px -26px rgba(34, 27, 18, 0.4);
  }
}
.use-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(19px, 2.4vw, 24px);
  letter-spacing: -0.01em;
}
.use-card p { margin: 0; color: var(--ink-soft); }

@media (max-width: 640px) {
  .uses-grid { grid-template-columns: 1fr; }
  .use-card:nth-child(1) { border-radius: 22px 160px 22px 22px; }
}

/* ============ contact ============ */

.contact {
  background: var(--night);
  color: var(--cream-on-night);
  padding: clamp(72px, 12vh, 150px) 0;
}
.contact .section-title { color: var(--cream-on-night); }
.contact .section-title em { color: #e2693c; }

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 88px);
  align-items: start;
}

.contact-lede {
  margin: 20px 0 0;
  font-size: clamp(17px, 2vw, 20px);
  color: rgba(243, 234, 217, 0.72);
  max-width: 38ch;
}

.contact-alt { margin-top: clamp(28px, 5vh, 48px); }
.contact-alt > p { margin: 0 0 12px; color: rgba(243, 234, 217, 0.72); }
.contact-email { margin-top: 14px !important; font-size: 15px; }
.contact-email a { color: var(--cream-on-night); }

.dream-form {
  background: var(--night-soft);
  border: 1px solid var(--line-light);
  border-radius: 26px;
  padding: clamp(24px, 3.4vw, 40px);
  display: grid;
  gap: 18px;
}

.field { display: grid; gap: 7px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 234, 217, 0.65);
}
.field .optional { text-transform: none; letter-spacing: 0; font-weight: 400; }

.field input,
.field textarea {
  font: inherit;
  color: var(--cream-on-night);
  background: rgba(243, 234, 217, 0.06);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 13px 15px;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(243, 234, 217, 0.35); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: #e2693c;
  background: rgba(243, 234, 217, 0.09);
}

.btn-submit { justify-content: center; width: 100%; }
.btn-submit[disabled] { opacity: 0.6; cursor: wait; }

.form-status { margin: 0; min-height: 1.4em; font-size: 15px; }
.form-status.ok { color: #9fc08a; }
.form-status.err { color: #e2906f; }

@media (max-width: 880px) {
  .contact-inner { grid-template-columns: 1fr; }
}

/* ============ footer ============ */

.site-footer {
  background: var(--night);
  color: rgba(243, 234, 217, 0.55);
  border-top: 1px solid var(--line-light);
  padding: 26px 0;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 22px; }
.footer-inner a { color: rgba(243, 234, 217, 0.8); text-decoration: none; }
.footer-inner a:hover { color: var(--cream-on-night); text-decoration: underline; }

/* ============ lightbox ============ */

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: visible;
}
.lightbox::backdrop {
  background: rgba(20, 15, 10, 0.92);
  backdrop-filter: blur(6px);
}
.lightbox[open] {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.lightbox figure { margin: 0; }
.lightbox img {
  max-width: min(86vw, 1000px);
  max-height: 76dvh;
  border-radius: 18px;
  animation: lb-in 320ms var(--ease-out);
}
@keyframes lb-in {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}
.lightbox figcaption {
  text-align: center;
  margin-top: 14px;
  color: var(--cream-on-night);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
}
.lb-close, .lb-nav {
  background: rgba(243, 234, 217, 0.1);
  color: var(--cream-on-night);
  border: 1px solid var(--line-light);
  border-radius: 999px;
  width: 46px; height: 46px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.lb-close:hover, .lb-nav:hover { background: rgba(243, 234, 217, 0.22); }
.lb-close { position: fixed; top: 18px; right: 18px; }

@media (max-width: 640px) {
  .lightbox[open] { grid-template-columns: 1fr; }
  .lb-nav { position: fixed; bottom: 22px; }
  .lb-prev { left: 22px; }
  .lb-next { right: 22px; }
  .lightbox img { max-width: 94vw; }
}

/* ============ scroll reveal ============ */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 800ms ease, transform 800ms var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-title .line > span { transform: none; animation: none; }
  .reveal, .strip-item { opacity: 1; transform: none; }
  .spark { opacity: 1; animation: none; }
}
