/* Shibui Coffee — one room, two lives. The light/dark switch isn't a system
   preference here, it's the brand: the day room (plaster, pale oak, pine) and
   the night room (walnut, amber cove light) are the same café at two hours. */

@font-face {
  font-family: 'Zen Mincho';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/zen-mincho-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Zen Mincho';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/zen-mincho-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Zen Kanji';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/zen-kanji-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/instrument-sans.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-sans-italic.woff2') format('woff2');
}

:root {
  --ground: #faf8f3;
  --panel: #f2ede3;
  --wood-a: #e6dac4;
  --wood-b: #dbccb1;
  --ink: #2a251d;
  --muted: #746b5c;
  --line: rgba(42, 37, 29, 0.16);
  --accent: #42594a;
  --accent-ink: #faf8f3;
  --cove: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%);
  --room-sky: #eae4d6;
  --shadow: 0 24px 60px -30px rgba(42, 37, 29, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #17120d;
    --panel: #1f1812;
    --wood-a: #2b2015;
    --wood-b: #241a11;
    --ink: #ede3d2;
    --muted: #a2947e;
    --line: rgba(237, 227, 210, 0.16);
    --accent: #d9a05b;
    --accent-ink: #1a130c;
    --cove: linear-gradient(180deg, rgba(217, 160, 91, 0.55), rgba(217, 160, 91, 0) 70%);
    --room-sky: #100c08;
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme='dark'] {
  --ground: #17120d;
  --panel: #1f1812;
  --wood-a: #2b2015;
  --wood-b: #241a11;
  --ink: #ede3d2;
  --muted: #a2947e;
  --line: rgba(237, 227, 210, 0.16);
  --accent: #d9a05b;
  --accent-ink: #1a130c;
  --cove: linear-gradient(180deg, rgba(217, 160, 91, 0.55), rgba(217, 160, 91, 0) 70%);
  --room-sky: #100c08;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
}

:root[data-theme='light'] {
  --ground: #faf8f3;
  --panel: #f2ede3;
  --wood-a: #e6dac4;
  --wood-b: #dbccb1;
  --ink: #2a251d;
  --muted: #746b5c;
  --line: rgba(42, 37, 29, 0.16);
  --accent: #42594a;
  --accent-ink: #faf8f3;
  --cove: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%);
  --room-sky: #eae4d6;
  --shadow: 0 24px 60px -30px rgba(42, 37, 29, 0.25);
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.7s ease,
    color 0.7s ease;
}

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

.kanji {
  font-family: 'Zen Kanji', 'Zen Mincho', serif;
}
.mincho {
  font-family: 'Zen Mincho', Georgia, serif;
}

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

.label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- theme switch ---------- */

.theme-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: transparent;
}

.theme-toggle button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--ground);
}

.theme-toggle .k {
  font-family: 'Zen Kanji', serif;
  margin-right: 0.35em;
  font-weight: 400;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.78rem 1.6rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.7s ease,
    color 0.7s ease,
    border-color 0.7s ease;
}

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

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

/* ---------- signup form ---------- */

.signup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  max-width: 34rem;
}

.signup input[type='email'] {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 2px;
  /* Matches .btn exactly, including its 1px transparent border, so the field
     and the button are the same height instead of off by a couple of pixels. */
  padding: 0.78rem 0.95rem;
  transition:
    background-color 0.7s ease,
    color 0.7s ease;
}

.signup input::placeholder {
  color: var(--muted);
}

.signup button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.signup-status {
  margin-top: 0.9rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--accent);
  min-height: 1.4em;
}

.signup-status[data-state='error'] {
  color: #b4442f;
}

@media (prefers-color-scheme: dark) {
  .signup-status[data-state='error'] {
    color: #e2896f;
  }
}

:root[data-theme='dark'] .signup-status[data-state='error'] {
  color: #e2896f;
}

:root[data-theme='light'] .signup-status[data-state='error'] {
  color: #b4442f;
}

/* ---------- entrance ---------- */

.rise {
  animation: rise 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}
.rise.d1 {
  animation-delay: 0.08s;
}
.rise.d2 {
  animation-delay: 0.18s;
}
.rise.d3 {
  animation-delay: 0.3s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body,
  .room-scene,
  .cove,
  .slats,
  .btn {
    transition: none !important;
  }
  .rise {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- the fiction note, shared by both pages ---------- */

.fiction {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px dotted var(--line);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.fiction p {
  font-size: 0.9rem;
  max-width: 46em;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.fiction p:last-child {
  margin-bottom: 0;
}

.fiction .k {
  font-family: 'Zen Kanji', serif;
  color: var(--accent);
  font-size: 1.1rem;
}

.fiction a {
  color: var(--accent);
}

.fiction strong {
  color: var(--ink);
  font-weight: 600;
}
