/* ============================================================
   Melissa Ewen Design — scroll-cinematic one-pager
   Palette + type taken from the live site's extracted brand kit:
   Castoro (serif) · Raleway (sans) · #FFF ground · #111 text · 0 radius
   ============================================================ */

:root{
  --paper:      #ffffff;
  --paper-warm: #f6f4f0;
  --ink:        #111111;
  --ink-soft:   #4a4a4a;
  --ink-faint:  #8b8b8b;
  --rule:       #e2ded8;

  /* material palette read off her project photography */
  --lacquer:    #1b3153;   /* the dining-room blue */
  --lacquer-dp: #14243d;
  --navy-deep:  #121f38;   /* contact + footer, one block to the page end */
  --haze:       #c9d4de;   /* pale blue-grey walls */
  --brass:      #a8874f;
  --oak:        #b08c5f;

  --serif: "Castoro", "Times New Roman", serif;
  --sans:  "Raleway", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  --gutter: clamp(1.5rem, 5vw, 6rem);
  --rhythm: clamp(6rem, 14vh, 12rem);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; background:var(--navy-deep); }
.visually-hidden{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:var(--sans); font-weight:400; line-height:1.65;
  -webkit-font-smoothing:antialiased; overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
::selection{ background:var(--lacquer); color:#fff; }

/* ---------- type ---------- */
.display{
  font-family:var(--serif); font-weight:400; line-height:1.04;
  letter-spacing:-0.02em; margin:0;
  font-size:clamp(2.4rem, 6.2vw, 6.2rem);
}
.display-sm{
  font-family:var(--serif); font-weight:400; line-height:1.12;
  letter-spacing:-0.015em; margin:0;
  font-size:clamp(1.9rem, 3.6vw, 3.4rem);
}
.lede{
  font-family:var(--serif);
  font-size:clamp(1.15rem, 1.9vw, 1.7rem); line-height:1.6;
  color:var(--ink-soft); margin:0;
}
p{ margin:0 0 1.15em; }
.meta{
  font-size:.7rem; letter-spacing:.22em; text-transform:uppercase;
  color:var(--ink-faint); font-weight:500;
}
.rule{ height:1px; background:var(--rule); border:0; margin:0; }

/* ---------- nav ---------- */
.nav{
  position:fixed; inset:0 0 auto 0; z-index:60;
  display:flex; align-items:center; justify-content:space-between;
  padding:1.35rem var(--gutter);
  color:#fff; text-shadow:0 1px 18px rgba(0,0,0,.55);
  transition:color .45s ease, text-shadow .45s ease, background .45s ease;
}
/* once the film is behind us the page turns white, so the nav must too */
.nav.on-paper{
  color:var(--ink); text-shadow:none;
  background:rgba(255,255,255,.86);
  backdrop-filter:saturate(180%) blur(12px);
  -webkit-backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--rule);
}
.nav-brand{
  font-family:var(--serif); font-size:1.02rem; letter-spacing:.02em;
}
.nav-links{ display:flex; gap:2.2rem; }
.nav-links a{
  font-size:.68rem; letter-spacing:.2em; text-transform:uppercase; font-weight:500;
  opacity:.85; transition:opacity .25s ease;
}
.nav-links a:hover{ opacity:1; }
@media (max-width:820px){ .nav-links{ display:none; } }

/* ============================================================
   1 — the scroll film
   ============================================================ */
.film{ position:relative; background:#0e1420; }
.film .stage{
  position:sticky; top:0; height:100vh; height:100svh;
  overflow:hidden; background:#0e1420;
}
.film canvas{ width:100%; height:100%; display:block; }

.film .scrim{
  position:absolute; inset:0; pointer-events:none;
  background:
    linear-gradient(180deg, rgba(8,12,20,.62) 0%, rgba(8,12,20,.14) 18%, rgba(8,12,20,0) 32%),
    linear-gradient(0deg,  rgba(8,12,20,.68) 0%, rgba(8,12,20,0) 46%);
}

.film-copy{
  position:absolute; inset:auto 0 0 0; z-index:3;
  pointer-events:none;
}
/* bottom-centered, full width with a gutter each side, just above SCROLL */
.film-line{
  position:absolute; left:var(--gutter); right:var(--gutter);
  bottom:clamp(4rem, 8.5vh, 6rem);
  text-align:center;
  opacity:0; will-change:opacity, transform;
  color:#fff;
}
.film-line .display{
  font-size:clamp(1.9rem, 4.6vw, 4.4rem);
  text-shadow:0 2px 40px rgba(0,0,0,.4);
}
.film-line .sub{
  font-size:.72rem; letter-spacing:.24em; text-transform:uppercase;
  margin-top:1rem; opacity:.82; font-weight:500;
}

.film-hint{
  position:absolute; left:50%; transform:translateX(-50%);
  bottom:1.6rem; z-index:4; color:#fff; opacity:.7;
  font-size:.62rem; letter-spacing:.28em; text-transform:uppercase;
  transition:opacity .5s ease;
}
.film-progress{
  position:absolute; left:var(--gutter); right:var(--gutter); bottom:0; z-index:4;
  height:1px; background:rgba(255,255,255,.18);
}
.film-progress i{ display:block; height:100%; width:0; background:#fff; }

/* ============================================================
   2 — mission
   ============================================================ */
.mission{
  padding:calc(var(--rhythm) * 1.15) var(--gutter);
  max-width:1180px; margin:0 auto; text-align:center;
}
.mission .display-sm{ max-width:20ch; margin:0 auto 2.2rem; }
.mission .lede{ max-width:62ch; margin:0 auto; }

/* ============================================================
   3 — the configurator
   ============================================================ */
.config{ position:relative; background:var(--paper-warm); }
.config .stage{
  position:sticky; top:0; height:100vh; height:100svh;
  display:grid; grid-template-columns:1fr; align-items:center;
  overflow:hidden;
}
.config-frame{
  position:absolute; inset:0;
}
.config-frame picture{ display:contents; }
.config-frame img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover;
  opacity:0; will-change:opacity;
}
.config-frame picture:first-child img{ opacity:1; }

.config-veil{
  position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(90deg, rgba(10,14,22,.62) 0%, rgba(10,14,22,.18) 44%, rgba(10,14,22,0) 70%);
}
/* portrait phones: full-bleed cover crops the changing furniture out of view,
   so the room becomes a framed change-zone crop with the captions beneath it.
   Fixed vertical rhythm — no centering games, dots pinned to the bottom,
   dvh so Safari's collapsing toolbar can never open a light gap. */
@media (max-width:820px) and (orientation:portrait){
  .config{ background:#10151f; }
  .config .stage{
    height:100vh; height:100dvh;
    display:flex; flex-direction:column; justify-content:flex-start;
    background:#10151f;
  }
  .config-frame{
    position:relative; inset:auto; flex:0 0 auto;
    width:100%; aspect-ratio:912/900; max-height:46dvh;
  }
  .config-veil{ display:none; }
  .config-panel{
    flex:1 1 auto; min-height:0;
    display:flex; flex-direction:column;
    padding:clamp(1.7rem,3.5dvh,2.6rem) var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
    max-width:none;
  }
  .config-panel h2{
    font-size:1.45rem; line-height:1.3; letter-spacing:0;
    margin:0 0 1.2rem; max-width:24ch;
  }
  /* the lede is desktop context — on a phone the heading, chip and note carry it */
  .config-panel .lede{ display:none; }
  .config-state{ min-height:0; }
  .config-chip{ margin-bottom:1rem; }
  .config-note{ font-size:1.3rem; max-width:26ch; }
  .config-dots{ margin-top:auto; padding-top:1.4rem; }
}
/* small landscape phones keep the overlay layout with a stronger veil */
@media (max-width:820px) and (orientation:landscape){
  .config-veil{ background:linear-gradient(90deg, rgba(10,14,22,.78) 0%, rgba(10,14,22,.3) 55%, rgba(10,14,22,0) 78%); }
  .config-panel .lede{ display:none; }
}

.config-panel{
  position:relative; z-index:3;
  padding:0 var(--gutter); color:#fff; max-width:34rem;
}
.config-panel h2{ margin:0 0 1.1rem; }
.config-panel .lede{ color:rgba(255,255,255,.78); margin-bottom:2.4rem; }

.config-state{ min-height:8.5rem; }
.config-chip{
  display:inline-block; font-size:.63rem; letter-spacing:.24em;
  text-transform:uppercase; font-weight:600;
  border:1px solid rgba(255,255,255,.42); padding:.5rem .95rem;
  margin-bottom:1.05rem;
}
.config-note{
  font-family:var(--serif); font-size:clamp(1.25rem,2.2vw,1.85rem);
  line-height:1.4; margin:0; color:#fff;
}
.config-dots{ display:flex; gap:.5rem; margin-top:2.1rem; }
.config-dots i{
  width:2.1rem; height:2px; background:rgba(255,255,255,.3); transition:background .35s ease;
}
.config-dots i.on{ background:#fff; }

.config-outro{
  padding:var(--rhythm) var(--gutter);
  max-width:1180px; margin:0 auto; text-align:center;
}
.config-outro .display-sm{ max-width:24ch; margin:0 auto; }

/* ============================================================
   4 — projects
   ============================================================ */
.section-head{
  padding:var(--rhythm) var(--gutter) clamp(2.5rem,5vh,4rem);
  max-width:1180px; margin:0 auto;
}
.section-head .display-sm{ max-width:18ch; margin-bottom:1.4rem; }
.section-head .lede{ max-width:56ch; }

.projects{ padding:0 var(--gutter) var(--rhythm); max-width:1400px; margin:0 auto; }
.project{
  display:grid; grid-template-columns:1.2fr 1fr; gap:clamp(1rem,2.6vw,3rem);
  align-items:end; padding:clamp(2.5rem,6vh,5rem) 0;
  border-top:1px solid var(--rule);
}
.project:last-child{ border-bottom:1px solid var(--rule); }
.project figure{ margin:0; overflow:hidden; }
.project figure img{
  width:100%; object-fit:cover;
  transition:transform 1.2s cubic-bezier(.16,1,.3,1);
}
.p-main img{ aspect-ratio:4/5; }
.p-sub  img{ aspect-ratio:4/3; }
.project:hover figure img{ transform:scale(1.035); }
.p-side{ display:flex; flex-direction:column; justify-content:flex-end; gap:clamp(1.2rem,3vh,2.2rem); }
.project-label{ padding-bottom:.4rem; }
.project-label h3{
  font-family:var(--serif); font-weight:400; margin:0 0 .5rem;
  font-size:clamp(1.5rem,2.8vw,2.4rem); line-height:1.15;
}
@media (max-width:820px){
  .project{ grid-template-columns:1fr; }
}

/* ============================================================
   5 — services (image cards)
   ============================================================ */
.section-head.centered{ text-align:center; }
.section-head.centered .display-sm,
.section-head.centered .lede{ margin-left:auto; margin-right:auto; }

.cards{
  display:grid; grid-template-columns:1fr 1fr;
  gap:clamp(1.5rem,3vw,3rem);
  max-width:1180px; margin:0 auto;
  padding:0 var(--gutter) var(--rhythm);
}
.card{
  background:#fff; border:1px solid var(--rule);
  display:flex; flex-direction:column;
  transition:transform .6s cubic-bezier(.16,1,.3,1),
             box-shadow .6s ease, border-color .6s ease;
}
.card:hover{
  transform:translateY(-6px);
  border-color:#cfc9c0;
  box-shadow:0 30px 60px -30px rgba(17,17,17,.28);
}
.card figure{ margin:0; overflow:hidden; }
.card figure img{
  width:100%; aspect-ratio:4/3; object-fit:cover;
  transition:transform 1.2s cubic-bezier(.16,1,.3,1);
}
.card:hover figure img{ transform:scale(1.045); }
.card-body{ padding:clamp(1.8rem,3vw,2.8rem); }
.card-body h3{
  font-family:var(--serif); font-weight:400; margin:0 0 1rem;
  font-size:clamp(1.5rem,2.4vw,2rem);
}
.card-body p{ color:var(--ink-soft); }
.card-body ul{ list-style:none; padding:0; margin:1.6rem 0 0; }
.card-body li{
  font-size:.76rem; letter-spacing:.13em; text-transform:uppercase;
  padding:.8rem 0; border-top:1px solid var(--rule); color:var(--ink-soft);
}
@media (max-width:820px){
  .cards{ grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce){
  .card, .card figure img{ transition:none; }
  .card:hover{ transform:none; }
}

/* ============================================================
   6 — about
   ============================================================ */
.about{
  display:grid; grid-template-columns:0.85fr 1fr;
  gap:clamp(2rem,6vw,6rem); align-items:center;
  padding:var(--rhythm) var(--gutter); max-width:1400px; margin:0 auto;
}
.about img{ width:100%; aspect-ratio:4/5; object-fit:cover; }
.about-body{ max-width:54ch; }
.about-body p{ color:var(--ink-soft); }
.about-body .display-sm{ margin-bottom:1.8rem; }
@media (max-width:820px){ .about{ grid-template-columns:1fr; } }

/* ============================================================
   7 — contact
   ============================================================ */
.contact{
  background:var(--navy-deep); color:#fff;
  padding:calc(var(--rhythm)*1.05) var(--gutter) clamp(3rem,7vh,5rem);
  text-align:center;
}
.contact .display-sm{ max-width:18ch; margin:0 auto 1.6rem; }
.contact .lede{ color:rgba(255,255,255,.74); max-width:46ch; margin:0 auto 3.2rem; }
.contact-grid{
  display:flex; flex-wrap:wrap; justify-content:center;
  gap:clamp(1.5rem,5vw,4.5rem); margin-bottom:3.2rem;
}
.contact-grid div{ text-align:center; }
.contact-grid .meta{ color:rgba(255,255,255,.55); margin-bottom:.5rem; }
.contact-grid a, .contact-grid span{
  font-family:var(--serif); font-size:clamp(1rem,1.5vw,1.2rem);
}
.contact-grid a:hover{ color:var(--haze); }
.btn{
  display:inline-block; background:#fff; color:var(--navy-deep);
  padding:1.15rem 2.6rem; font-size:.7rem; letter-spacing:.24em;
  text-transform:uppercase; font-weight:600;
  transition:background .3s ease, color .3s ease;
}
.btn:hover{ background:var(--haze); }

.rule-soft{
  height:1px; background:rgba(255,255,255,.14); border:0;
  max-width:1180px; margin:clamp(3rem,7vh,5rem) auto;
}

/* email capture */
.subscribe h3{
  font-family:var(--serif); font-weight:400; margin:0 0 .9rem;
  font-size:clamp(1.4rem,2.2vw,1.9rem);
}
.subscribe .sub-copy{
  color:rgba(255,255,255,.7); max-width:52ch; margin:0 auto;
}
.subscribe form{
  display:flex; max-width:30rem; margin:2rem auto 0;
}
.subscribe input{
  flex:1; min-width:0;
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.28);
  border-right:0; color:#fff; border-radius:0;
  padding:1.05rem 1.2rem; font-family:var(--sans);
  font-size:.9rem; letter-spacing:.02em; outline:none;
  transition:border-color .3s ease, background .3s ease;
}
.subscribe input::placeholder{ color:rgba(255,255,255,.45); }
.subscribe input:focus{
  border-color:rgba(255,255,255,.6); background:rgba(255,255,255,.11);
}
.subscribe button{
  background:#fff; color:var(--navy-deep); border:0; cursor:pointer;
  padding:1.05rem 1.7rem; font-family:var(--sans);
  font-size:.68rem; letter-spacing:.2em; text-transform:uppercase; font-weight:600;
  transition:background .3s ease;
}
.subscribe button:hover{ background:var(--haze); }
.subscribe .thanks{
  display:none; font-family:var(--serif);
  font-size:1.15rem; margin:2rem 0 0;
}
.subscribe.sent form{ display:none; }
.subscribe.sent .thanks{ display:block; }
@media (max-width:560px){
  .subscribe form{ flex-direction:column; gap:.7rem; }
  .subscribe input{ border-right:1px solid rgba(255,255,255,.28); text-align:center; }
}

footer{
  background:var(--navy-deep); color:#fff;
  padding:0 var(--gutter) 3.2rem; text-align:center;
}
footer .foot-brand{
  font-family:var(--serif); font-size:clamp(1.15rem,1.8vw,1.4rem); margin:0 0 1rem;
}
footer .foot-row{
  display:flex; flex-wrap:wrap; justify-content:center;
  gap:.5rem clamp(1.2rem,3vw,2rem);
}
footer .meta{ color:rgba(255,255,255,.55); }
footer a.meta:hover{ color:var(--haze); }

/* ---------- scroll reveals ---------- */
.rise{
  opacity:0; transform:translateY(28px);
  transition:opacity 1.05s cubic-bezier(.16,1,.3,1), transform 1.05s cubic-bezier(.16,1,.3,1);
}
.rise.in{ opacity:1; transform:none; }
.rise.d1{ transition-delay:.09s; }
.rise.d2{ transition-delay:.18s; }
.rise.d3{ transition-delay:.27s; }

@media (prefers-reduced-motion:reduce){
  .rise{ opacity:1; transform:none; transition:none; }
  .project figure img{ transition:none; }
}
