@import url("fonts.css?v=1");

/* =============================================================================
 *  daich.studio — stylesheet
 *
 *  Derived from the daichiito.com design: a VR panorama top page, a dark
 *  top-left menu panel (menu_back.png), and dark rounded "window" frames
 *  (window_frame.svg) holding the content on interior pages.
 * ========================================================================== */

/* ---------- Base ---------- */
:root {
  --fg: #f3f1ea;                 /* warm off-white text                        */
  --ink: #14161c;                /* near-black text inside form fields         */
  --edit-blue: #0048fc;          /* accent blue (active menu item, buttons)    */
  --edit-blue-deep: #0037bf;
  --link: #7ea2ff;               /* links on the dark window                   */
  --link-hover: #a9c1ff;
  --shadow: rgba(0, 0, 0, 0.55);
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-display);
  color: var(--fg);
  background: #05080d; /* shown until the panorama paints */
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Panorama canvas (top page background) ---------- */
#pano {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  cursor: grab;
  touch-action: none;          /* let JS own touch gestures (no page scroll) */
}
#pano:active { cursor: grabbing; }
#pano.is-ready { opacity: 1; }

/* Fallback if WebGL is unavailable: show the center of the panorama. */
#pano-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #05080d url("../images/downtown_bg.jpg") center center / cover no-repeat;
}

/* ---------- Top-left title + menu ---------- */
.ui--topleft {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  width: 248px;
  height: 272px;
  padding: 21px 23px;
  /* The artwork panel (semi-transparent dark with a curved edge). */
  background: url("../images/menu_back.png") top left / 248px 272px no-repeat;
}

.brand {
  margin: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}
.brand__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;        /* tight, wordmark-like */
  line-height: 0.98;
  white-space: nowrap;
  text-shadow: 0 1px 10px var(--shadow);
}

/* Menu items: white, turn black on hover; the current page is accent blue. */
.menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 30px;
}
.menu__item {
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-shadow: 0 1px 8px var(--shadow);
  transition: color 0.18s ease;
}
.menu__item:hover,
.menu__item:focus-visible { color: #000; text-shadow: none; }
.menu__item[aria-current="page"] { color: var(--edit-blue); text-shadow: none; }

/* ---------- Look-around arrows ---------- */
.arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 19px;          /* half of the 38×77 native arrow size */
  height: 38px;
  padding: 0;
  border: 0;
  background: center / contain no-repeat transparent;
  cursor: pointer;
  opacity: 0.7;
  filter: drop-shadow(0 1px 6px var(--shadow));
  transition: opacity 0.18s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.arrow:hover { opacity: 1; }
.arrow.is-pressed { opacity: 1; transform: translateY(-50%) scale(0.9); }
.arrow--left  { left: 18px;  background-image: url("../images/arrow_left.png"); }
.arrow--right { right: 18px; background-image: url("../images/arrow_right.png"); }

/* ---------- Hint ---------- */
.hint {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.55;
  text-shadow: 0 1px 8px var(--shadow);
  transition: opacity 0.6s ease;
}
.hint.is-hidden { opacity: 0; }

/* =====================================================================
 *  Interior pages — normal scrolling document over a FIXED background.
 *  The background (center of the Downtown panorama) never moves; only the
 *  menu and the content windows scroll.
 * ===================================================================== */

html:has(body.subpage) { height: auto; }
body.subpage {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  background: #2b3a4a;             /* fallback color behind the image */
}
body.subpage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #2b3a4a url("../images/downtown_bg.jpg") center center / cover no-repeat;
  pointer-events: none;
}

/* On interior pages the menu scrolls with the document instead of being fixed. */
.subpage .ui--topleft { position: absolute; }

/* Content column. Mobile-first: the framed block sits below the menu. */
.content {
  position: relative;
  z-index: 1;
  padding: 290px 18px 72px;
}

/* ---------- Framed content window (window_frame.svg) ---------- */
.frame-window {
  max-width: 720px;
  margin: 0 auto;
  color: var(--fg);
  background: transparent;
  /* Scalable vector frame: corner slices stay crisp, edges stretch, the
     semi-transparent black center fills behind the content. */
  border: 70px solid transparent;
  border-image: url("../images/window_frame.svg?v=1") 200 fill stretch;
}
@media (max-width: 560px) {
  .frame-window { border-width: 48px; }
}

/* Landscape: the window's top-left corner slides from below the menu (narrow)
   to beside it (wide), then the window widens into the free space. */
@media (min-width: 780px) {
  .content {
    padding: clamp(76px, calc(290px - (100vw - 780px) * 0.7810), 290px) 0 96px;
  }
  .frame-window {
    margin-left: clamp(30px, calc(30px + (100vw - 780px) * 0.7518), 236px);
    margin-right: auto;
    max-width: clamp(720px, calc(100vw - 334px), 1080px);
  }
}

.frame-window__title {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
}
.frame-window__eyebrow {
  margin: 0 0 1.4em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 241, 234, 0.6);
}
.frame-window p {
  margin: 0 0 1.05em;
  font-size: 1rem;
  line-height: 1.62;
}
.frame-window p:last-child { margin-bottom: 0; }
.frame-window .lead {
  font-size: 1.16rem;
  line-height: 1.55;
  font-weight: 500;
}

/* Subsection heading + bullet list. */
.frame-window__subtitle {
  margin: 1.7em 0 0.55em;
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.frame-window__subtitle--step {
  margin-top: 1.4em;
  color: #9ee7ff;                  /* echoes the cyan step titles in the app */
}
.frame-window__list {
  margin: 0 0 1.05em;
  padding-left: 1.25em;
}
.frame-window__list li {
  margin: 0 0 0.4em;
  font-size: 1rem;
  line-height: 1.55;
}
.frame-window__list li::marker { color: var(--link); }

/* Links inside a content window. */
.frame-window a {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(126, 162, 255, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.frame-window a:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }

/* Multiple windows on one page stack with spacing. */
.content > .frame-window + .frame-window { margin-top: 56px; }

/* Thin separator line between sections inside a window. */
.frame-window hr {
  border: 0;
  border-top: 1px solid rgba(243, 241, 234, 0.18);
  margin: 1.8em 0;
}

/* ---------- Media (figures / galleries) ---------- */
.media {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 22px 0 10px;
}
.media__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.media__figure { margin: 0; }
.media__figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.media__figure--illustration img {
  background: #fff;                 /* the d1/d2 line drawings sit on white */
}
.media__figure figcaption {
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(243, 241, 234, 0.62);
  line-height: 1.5;
}
.media__figure--narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
@media (max-width: 560px) {
  .media__pair { grid-template-columns: 1fr; }
}

/* Feature rows: a screenshot with its caption underneath, stacked. */
.feature {
  margin: 26px 0 0;
}
.feature__caption {
  margin: 12px 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 500;
}
.feature__caption strong { color: #fff; }

/* Small note (e.g. requirements) */
.frame-window .note {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(243, 241, 234, 0.75);
}

/* Credit line (Artist: …) */
.frame-window .credit {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: rgba(243, 241, 234, 0.75);
}

/* ---------- Usage notice ---------- */
.notice {
  margin: 1.8em 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 120, 120, 0.55);
  background: rgba(255, 90, 90, 0.10);
}
.notice p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #ffb4b4;
}
.notice strong { color: #ffd0d0; }

/* ---------- Legal / policy pages ---------- */
.policy__meta {
  margin: 0 0 1.6em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(243, 241, 234, 0.65);
}
.policy h3.frame-window__subtitle { font-size: 1.12rem; }
.policy .frame-window__list li { margin-bottom: 0.55em; }

/* ---------- Contact form ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }

.form__row { display: flex; flex-direction: column; gap: 7px; }
.form__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(243, 241, 234, 0.72);
}
.form__input {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #c5cad6;
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form__input:focus {
  outline: none;
  border-color: var(--edit-blue);
  box-shadow: 0 0 0 3px rgba(0, 72, 252, 0.15);
}
.form__textarea { resize: vertical; min-height: 130px; line-height: 1.5; }

.form__row--inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.form__row--inline .form__label { margin: 0; }
.form__input--small { width: 96px; text-align: center; }

.form__submit {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
  background: var(--edit-blue);
  border: 0;
  border-radius: 11px;
  padding: 13px 26px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.06s ease;
}
.form__submit:hover { background: var(--edit-blue-deep); }
.form__submit:active { transform: translateY(1px); }

/* Honeypot: visually and pragmatically hidden, but present in the DOM. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Status messages */
.form-note {
  margin: 0 0 1.1em;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.98rem;
  line-height: 1.5;
}
.form-note--ok  { background: #e7f6ec; border: 1.5px solid #45b283; color: #166534; }
.form-note--err { background: #fdecec; border: 1.5px solid #e3a3a3; color: #9b1c1c; }
