/* ============================================================
   KAZZA — The House of Becoming
   Editorial replica of the kaiseisadatoki-v4 reference.
   Fonts: The Night Watch (display) · Zen Old Mincho (serif) · Inter (body)
   Palette: cream #fffdf1 · terracotta #9e3b22 (burnt brick, main) · tan #e1dbc3
   ============================================================ */

@font-face {
  font-family: "The Night Watch";
  src: url("../fonts/TheNightWatch.woff2") format("woff2");
  font-display: swap;
}

:root {
  --cream: #fffdf1;
  --brand: #9e3b22;         /* terracotta — main: fills, links, headings (AA on cream) */
  --brand-hover: #b8492b;   /* hover lift on solid fills */
  --brand-deep: #641e0c;    /* pressed / deepest accents */
  --clay: #b5522f;           /* secondary warm accent (AA on cream) */
  --tan:   #e1dbc3;
  --pad:   clamp(16px, 7.549px + 2.254vw, 40px);   /* header inset */
  --wrap:  clamp(16px, 2.27px + 3.661vw, 96px);    /* body content inset (ref .l-wrapper) */
}

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

html { -webkit-font-smoothing: antialiased; overflow-x: hidden; }

body {
  width: 100%;
  min-height: 100%;
  font-family: Inter, sans-serif;
  font-weight: 500;
  background-color: var(--cream);
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }

/* ---------- type scale (ported) ---------- */
.text-display { font-family: "The Night Watch", serif; letter-spacing: -.02em; line-height: 1; }
.text-serif   { font-family: "Zen Old Mincho", serif; }
.text-3xl { font-size: clamp(2rem, 1.82rem + .75vw, 2.5rem); letter-spacing: -.02em; line-height: 1.2; }
.text-lg  { font-size: clamp(.875rem, .787rem + .38vw, 1.125rem); letter-spacing: -.02em; line-height: 1.35; }
.text-base{ font-size: clamp(.8125rem, .77rem + .19vw, .9375rem); letter-spacing: -.02em; line-height: 1.4; }
.text-sm  { font-size: clamp(.75rem, .706rem + .19vw, .875rem); letter-spacing: -.02em; line-height: 1.2; }
.text-xs  { font-size: clamp(.625rem, .583rem + .19vw, .75rem); letter-spacing: -.02em; line-height: 1.2; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.tan { color: var(--tan); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- marquee ticker ---------- */
.ticker {
  display: flex; overflow: hidden;
  background-color: var(--brand); color: var(--cream);
  padding: 12px 0; font-weight: 400;
  white-space: nowrap;
}
.ticker__track { display: flex; flex-shrink: 0; gap: 40px; padding-left: 40px; animation: marquee 32s linear infinite; }
.ticker span { white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- header ---------- */
.header {
  width: 100%;
  padding: clamp(24px,18px+1.5vw,40px) var(--pad) 0;
  display: flex; justify-content: space-between; align-items: start;
}
@media (min-width:1024px){ .header{ align-items:center; } }
.brand { display: flex; align-items: center; }
.brand__logo { height: clamp(48px, 4.6vw, 68px); width: auto; display: block; }
.nav { display: none; }
@media (min-width:1024px){ .nav{ display:flex; gap:32px; } }
.nav a { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; position: relative; padding-bottom: 2px; }
.nav a::after { content:""; position:absolute; left:0; bottom:-2px; width:0; height:1px; background:var(--brand); transition:width .3s ease; }
.nav a:hover::after { width:100%; }
.nav__index { opacity:.55; margin-right:5px; }
.menu-btn { font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; z-index:5500; position:relative; }
@media (min-width:1024px){ .menu-btn{ display:none; } }
@media (max-width:1023px){
  .nav { display:flex; position:fixed; inset:0; background:var(--cream); flex-direction:column;
         justify-content:center; gap:22px; padding:0 var(--pad); z-index:5000;
         transform:translateY(-100%); transition:transform .55s cubic-bezier(.7,0,.2,1); }
  body.menu-open .nav { transform:none; }
  .nav a { font-size:2rem; letter-spacing:.02em; }
  .nav__index { font-size:1rem; }
  body.menu-open { overflow:hidden; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(48px,6vw,104px) var(--wrap) clamp(80px,10vw,160px); }
.hero__word {
  font-family:"The Night Watch", serif; color: var(--brand);
  font-size: clamp(2rem, 7.5vw, 6rem);
  line-height: .98; letter-spacing: -.01em; margin: 0 0 28px;
}
.hero__meta { text-transform: uppercase; letter-spacing:.1em; font-size: clamp(.75rem,.7rem+.2vw,.9rem); margin-bottom: 40px; }
.hero__meta span { display:block; }
.hero__meta span + span { color: var(--clay); margin-top: 4px; }
.hero__intro { max-width: 460px; }
/* hero CTA */
.hero__cta { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cta-btn { display: inline-flex; align-items: center; gap: 12px; background: var(--brand); color: var(--cream);
  border-radius: 100px; padding: 16px 34px; font-size: .82rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; transition: background .25s ease, transform .25s ease, gap .25s ease; }
.cta-btn:hover { background: var(--brand-hover); transform: translateY(-2px); gap: 18px; }
.cta-btn svg { width: 15px; height: 15px; }
.cta-note { font-size: .8rem; letter-spacing: .04em; color: var(--clay); }

/* TEMP: footer menu hidden until the sub-pages (The House, etc.) are live.
   To restore, delete this one rule. */
.foot-col--menu { display: none; }
.hero__edge {
  position: absolute; top: 30%; right: clamp(6px,1vw,16px);
  writing-mode: vertical-rl; text-orientation: mixed;
  font-size: .68rem; letter-spacing:.28em; text-transform: uppercase; opacity:.7;
}
@media (max-width:1023px){ .hero__edge{ display:none; } }

/* ---------- footer ---------- */
.footer { width:100%; padding-top: clamp(64px,10vw,120px); overflow:hidden; }
.footer__grid {
  width:100%; padding: 0 var(--wrap);
  margin-bottom: clamp(48px,8vw,96px);
}
.foot-col { min-width: 0; }
.foot-col__grid { display:grid; grid-template-columns: auto auto; justify-content:start; gap: 2px clamp(40px,7vw,110px); }
.foot-col__label { font-size:.68rem; text-transform:uppercase; letter-spacing:.14em; opacity:.6; margin-bottom:12px; }
.foot-col a, .foot-col p { font-size: clamp(.8rem,.76rem+.2vw,.95rem); line-height:1.6; display:block; width:fit-content; max-width:100%; overflow-wrap:anywhere; }
.foot-col a { position:relative; }
.foot-col a:hover { opacity:.65; }
.foot-col__row { display:flex; gap: clamp(28px,4vw,48px); align-items:baseline; margin-bottom:3px; }
.foot-col__row .idx { opacity:.5; font-variant-numeric: tabular-nums; }
.footer__logo-wrap {
  padding: clamp(48px,7vw,88px) var(--wrap) clamp(28px,3vw,44px);
  text-align: center;
}
.footer__logo { width: clamp(130px, 15vw, 190px); height: auto; display: inline-block; opacity: .85; }
.footer__credit { text-align:center; font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; opacity:.6; padding: 20px var(--wrap) 40px; }

/* ---------- film-grain texture ---------- */
#grain { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ---------- floating concierge (unframed, lower-left) ---------- */
.chat { position: fixed; right: clamp(16px,2vw,40px); bottom: clamp(18px,2.4vw,34px);
  z-index: 70; width: 320px; max-width: calc(100vw - 32px); color: var(--brand); }
/* the chatbot's own launcher — reference circle + dot, floating bottom-right */
.chat__launch { display: flex; align-items: center; gap: 15px; margin-left: auto;
  background: transparent; border: none; cursor: pointer; color: var(--brand); }
.chat__launch-label { font-family: Inter, sans-serif; font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1.3; text-align: right; }
.chat__launch-circle { width: 58px; height: 58px; border: 1px solid var(--brand); border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0; transition: background .35s ease; }
.chat__launch-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
  transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.chat__launch:hover .chat__launch-circle { background: rgba(158,59,34,.09); }
.chat__launch:hover .chat__launch-dot { transform: scale(1.9); }
.chat[data-open="true"] .chat__launch { display: none; }
.chat__panel { display: none; }
.chat[data-open="true"] .chat__panel { display: block; animation: chatIn .5s cubic-bezier(.2,.7,.2,1); }
@keyframes chatIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.chat__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chat__eyebrow { font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; opacity: .65; }
.chat__close { background: transparent; border: none; color: var(--brand); font-size: 1.2rem;
  line-height: 1; cursor: pointer; opacity: .65; transition: opacity .3s ease; }
.chat__close:hover { opacity: 1; }
.chat__log { display: flex; flex-direction: column; gap: 13px; max-height: 44vh; overflow-y: auto;
  margin-bottom: 15px; padding-right: 4px; }
.chat__log::-webkit-scrollbar { width: 3px; }
.chat__log::-webkit-scrollbar-thumb { background: rgba(158,59,34,.3); border-radius: 3px; }
.chat__msg { font-size: .92rem; line-height: 1.5; max-width: 94%; }
.chat__msg--bot { color: var(--brand); }
.chat__msg--user { color: var(--clay); align-self: flex-end; text-align: right; }
.chat__msg--typing { opacity: .5; }
.chat__form { display: flex; align-items: center; gap: 10px;
  border-top: 1px solid rgba(158,59,34,.32); padding-top: 13px; }
.chat__input { flex: 1; background: transparent; border: none; outline: none;
  font-family: Inter, sans-serif; font-size: .9rem; color: var(--brand); }
.chat__input::placeholder { color: rgba(158,59,34,.5); }
.chat__send { background: transparent; border: none; color: var(--brand); font-size: 1.05rem;
  cursor: pointer; transition: opacity .3s ease; }
.chat__send:hover { opacity: .6; }
/* mobile: keep the launcher, open into a readable bottom sheet */
@media (max-width: 1023px) {
  .chat { left: 12px; right: 12px; bottom: 14px; width: auto; }
  .chat__launch { gap: 12px; }
  .chat__launch-circle { width: 52px; height: 52px; }
  .chat[data-open="true"] .chat__panel {
    background: rgba(255,253,241,.97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid rgba(158,59,34,.28); border-radius: 16px;
    padding: 18px 18px 16px; box-shadow: 0 24px 70px rgba(58,20,10,.22);
  }
  .chat__log { max-height: 42vh; }
  .chat__input { font-size: 16px; }  /* prevents iOS auto-zoom on focus */
}

/* ---------- placeholder modal ---------- */
.modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }
.modal.open { opacity: 1; visibility: visible; transition: opacity .45s ease; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(58,20,10,.42); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.modal__card {
  position: relative; z-index: 1; background: var(--cream); color: var(--brand);
  border: 1px solid var(--brand); border-radius: 16px; max-width: 520px; width: 100%;
  padding: clamp(34px,5vw,60px); text-align: center;
  box-shadow: 0 40px 100px rgba(58,20,10,.28);
  transform: translateY(18px) scale(.955); opacity: 0;
  transition: transform .55s cubic-bezier(.2,.7,.2,1), opacity .5s ease;
}
.modal.open .modal__card { transform: none; opacity: 1; }
.modal__eyebrow { font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; opacity: .68; margin-bottom: 16px; }
.modal__title { font-family: "The Night Watch", serif; font-size: clamp(3rem,8.5vw,5.25rem); line-height: 1.14; letter-spacing: -.01em; margin-bottom: 18px; }
.modal__text { font-size: .95rem; line-height: 1.55; max-width: 350px; margin: 0 auto 30px; }
.modal__close { background: transparent; color: var(--brand); font-family: Inter, sans-serif;
  border: 1px solid var(--brand); border-radius: 100px; padding: 12px 28px; cursor: pointer;
  font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  transition: background .3s ease, color .3s ease; }
.modal__close:hover { background: var(--brand); color: var(--cream); }
/* reveal (ported from reference: rise-from-mask + fade, char-stagger on title) */
.modal__eyebrow, .modal__text, .modal__close { opacity: 0; transform: translateY(14px);
  transition: opacity .7s ease, transform .85s cubic-bezier(.16,.84,.44,1); }
.modal.open .modal__eyebrow { opacity: 1; transform: none; transition-delay: .08s; }
.modal.open .modal__text    { opacity: 1; transform: none; transition-delay: .30s; }
.modal.open .modal__close   { opacity: 1; transform: none; transition-delay: .44s; }
.modal__title .ch-wrap { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .01em; }
.modal__title .ch { display: inline-block; transform: translateY(130%);
  transition: transform .9s cubic-bezier(.16,.84,.44,1); }
.modal.open .modal__title .ch { transform: translateY(0); }

/* ---------- side social (vertical, right edge — two words side by side) ---------- */
.side-social { position: fixed; right: clamp(8px,1.2vw,20px); top: 50%; transform: translateY(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.side-social a { writing-mode: vertical-rl; font-size: .66rem; letter-spacing: .22em;
  text-transform: uppercase; transition: opacity .3s ease; }
.side-social a:hover { opacity: .55; }
@media (max-width: 1023px) { .side-social { display: none; } }

/* ---------- custom cursor ---------- */
.cursor { position: fixed; width:46px; height:46px; border-radius:50%; border:1px solid var(--brand); pointer-events:none; z-index:9999; transform:translate(-50%,-50%); transition: width .25s ease, height .25s ease, background-color .25s ease; display:none; mix-blend-mode:multiply; }
.cursor__dot { position:absolute; top:50%; left:50%; width:5px; height:5px; border-radius:50%; background:var(--brand); transform:translate(-50%,-50%); }
.cursor.hover { width:70px; height:70px; background: rgba(158,59,34,.08); }
@media (hover:hover) and (pointer:fine){ .cursor{ display:block; } }
