/* Yukae - shared styles for yukae.app.
   Paper, ink and the red of the magic circle, taken from the app's paintings. */

@font-face {
  font-family: "Tegaki";
  src: url("tegaki.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Cardo";
  src: url("cardo.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f3eee3;
  --paper-deep: #e8dfcd;
  --ink: #2a2520;
  --ink-soft: #564d43;
  --red: #b3262e;
  --red-deep: #8a1c22;
  --teal: #3f8e9b;
  --line: rgba(42, 37, 32, 0.14);
  --card: rgba(255, 252, 245, 0.7);
  --night: #15171c;
  --night-ink: #ece7dc;

  /* the beiges the page walks through, top to bottom */
  --sand-1: #f2ead9;
  --sand-2: #f7f2e7;
  --sand-3: #eadcc1;
  --sand-4: #e4d3b2;
  --sand-5: #f1e8d6;

  --hand: "Tegaki", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --body: "Cardo", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.22rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--red-deep); }
h1, h2, h3 { font-family: var(--hand); font-weight: normal; line-height: 1.15; margin: 0 0 0.45em; }
h2 { font-size: clamp(2.3rem, 5.5vw, 3.4rem); }
h3 { font-size: 1.8rem; }
p { margin: 0 0 0.9em; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- the red drape along the top, as in the app ---------- */
.drape {
  /* the top of its long red runs off the screen */
  position: absolute; top: calc(min(540px, 100vw) * -0.12); left: 50%; transform: translateX(-50%);
  width: min(540px, 100vw); pointer-events: none; z-index: 2;
  /* the painting stops in hard edges at its top corners: fade the sides away */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
}
@media (max-width: 760px) {
  /* on a phone it spans the screen, exactly as in the app */
  .drape { -webkit-mask-image: none; mask-image: none; }
}
/* the links spread across the drape: the outer ones up high, the middle ones lower,
   following the curve of the cloth ( -__- ) */
.nav {
  position: relative; z-index: 3;
  width: calc(min(540px, 100vw) * 0.7); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start; column-gap: 10px;
  padding: 12px 0 0;
}
.nav a {
  color: #fff8ee; text-decoration: none; font-family: var(--hand); font-size: 1.3rem;
  text-shadow: 0 1px 6px rgba(60, 0, 0, 0.6);
}
.nav a:not(:first-child):not(:last-child) { margin-top: calc(min(540px, 100vw) * 0.075); }
.nav a:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .nav { padding-top: 8px; }
  .nav a { font-size: 1.1rem; }
  .tagline br { display: none; }
}

/* ---------- hero ----------
   On a wide screen the words sit on the left and the painting's glowing heart
   stays clear on the right; on a phone the words sit below it. */
.hero {
  position: relative; min-height: min(100vh, 1000px); display: flex; flex-direction: column;
  background: url("hero-wide.webp") 0% 50% / cover no-repeat;
  overflow: hidden;
}
.hero::after { /* a soft wash behind the words, and the bottom melting into the page */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 22% 62%, rgba(243, 236, 222, 0.85) 0, rgba(243, 236, 222, 0.4) 55%, transparent 80%),
    linear-gradient(to bottom, transparent 72%, var(--sand-1) 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  margin: auto auto auto max(16px, 6vw); padding: 190px 16px 90px;
  max-width: 600px; text-align: left;
}
.hero-inner .stores { justify-content: flex-start; }
.app-icon { width: 96px; border-radius: 22px; margin: 0 0 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.hero h1 { font-size: clamp(2.6rem, 11.5vw, 5.4rem); margin-bottom: 0.1em; white-space: nowrap; }
.tagline { font-size: clamp(1.25rem, 3.4vw, 1.6rem); color: var(--ink); margin-bottom: 1.2em; max-width: 30em; }
.small { font-size: 1rem; color: var(--ink-soft); }

@media (max-width: 760px) {
  .hero { background-image: url("hero-tall.webp"); background-position: center; min-height: min(100svh, 940px); }
  .hero::after {
    background: linear-gradient(to bottom, transparent 0, transparent 52%, rgba(242, 234, 217, 0.82) 66%, var(--sand-1) 100%);
  }
  .hero-inner { margin: auto 0 0; padding: 0 16px 36px; text-align: center; max-width: none; }
  .hero-inner .stores { justify-content: center; }
  /* the painting's glowing heart sits mid-screen on a phone: keep it clear */
  .hero .app-icon, .hero-langs { display: none; }
}

.stores { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px;
  padding: 10px 22px; border-radius: 12px; text-decoration: none;
  background: var(--ink); color: #fff; font-family: var(--body); font-size: 1.1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2); transition: transform .2s ease, background .2s ease;
}
.store:hover { transform: translateY(-2px); background: var(--red-deep); }
.store svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store small { font-size: 0.74rem; opacity: 0.8; }

/* ---------- the page's beige bands, each melting into the next ---------- */
section { position: relative; padding: clamp(44px, 6vw, 80px) 0; }
.band-a {
  background:
    radial-gradient(circle at 8% 12%, rgba(63, 142, 155, 0.10), transparent 32%),
    radial-gradient(circle at 92% 46%, rgba(179, 38, 46, 0.07), transparent 30%),
    radial-gradient(circle at 12% 82%, rgba(110, 160, 90, 0.08), transparent 30%),
    linear-gradient(180deg, var(--sand-1) 0%, var(--sand-2) 30%, var(--sand-2) 60%, var(--sand-3) 100%);
}
.band-b {
  background:
    radial-gradient(circle at 90% 18%, rgba(63, 142, 155, 0.09), transparent 32%),
    radial-gradient(circle at 6% 70%, rgba(179, 38, 46, 0.06), transparent 30%),
    linear-gradient(180deg, var(--sand-3) 0%, var(--sand-2) 35%, var(--sand-2) 70%, var(--sand-4) 100%);
}
.band-c {
  background:
    radial-gradient(circle at 85% 30%, rgba(214, 170, 60, 0.12), transparent 35%),
    linear-gradient(180deg, var(--sand-4) 0%, var(--sand-5) 40%, var(--sand-2) 75%, var(--sand-3) 100%);
}

.intro { text-align: center; max-width: 820px; margin: 0 auto; }
.intro p { font-size: 1.4rem; }
.brush-rule {
  width: 140px; height: 6px; margin: 0 auto 24px; border-radius: 6px;
  background: linear-gradient(90deg, transparent, var(--red) 20%, var(--red-deep) 80%, transparent);
}

/* ---------- feature rows: words beside a phone ---------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; padding: clamp(24px, 4vw, 44px) 0; position: relative;
}
.feature.flip .feature-text { order: 2; }
.feature-text { position: relative; z-index: 1; }
.feature-text h3 { font-size: clamp(2.3rem, 4.6vw, 3.2rem); }
.feature-text p, .feature-text li { font-size: 1.32rem; }
.kicker { font-family: var(--hand); color: var(--red); font-size: 1.45rem; margin-bottom: 0.1em; }
.phone {
  position: relative; z-index: 1;
  width: min(330px, 80vw); margin: 0 auto; border-radius: 36px; padding: 9px;
  background: linear-gradient(145deg, #3a332c, #14110e);
  box-shadow: 0 30px 60px rgba(40, 20, 10, 0.28), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.phone img, .phone video { border-radius: 28px; width: 100%; }
.duo { display: flex; gap: 18px; justify-content: center; align-items: flex-start; }
.duo .phone { width: min(250px, 43vw); }
.duo .phone:nth-child(2) { margin-top: 60px; }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature.flip .feature-text { order: 0; }
}

ul.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.ticks li { padding-left: 1.5em; position: relative; margin-bottom: 0.4em; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 0.6em; height: 0.6em;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(179, 38, 46, 0.18);
}

/* a phone whose screen turns through several pictures */
.slides img:not(:first-child) {
  position: absolute; top: 9px; left: 9px; width: calc(100% - 18px);
  opacity: 0; animation: slide-in 17.5s infinite;
}
.slides img:nth-child(2) { animation-delay: 3.5s; }
.slides img:nth-child(3) { animation-delay: 7s; }
.slides img:nth-child(4) { animation-delay: 10.5s; }
.slides img:nth-child(5) { animation-delay: 14s; }
@keyframes slide-in { 0% { opacity: 0; } 4% { opacity: 1; } 20% { opacity: 1; } 24% { opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .slides img:not(:first-child) { animation: none; } }

/* the opened scroll, with what was inside it */
.art-scroll { width: min(560px, 100%); margin: 0 auto; }

/* the painted tree, standing faintly behind its own row; its foot fades into the page */
.tree-ghost {
  position: absolute; z-index: 0; top: 50%; left: 50%; transform: translate(-50%, -50%);
  height: 125%; width: auto; max-width: none; opacity: 0.32; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 70%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0, #000 70%, transparent 96%);
}

/* ---------- the dark band for the rhythm game, fading in and out of the beige ---------- */
.night {
  background: var(--night) url("dark.webp") center / cover;
  color: var(--night-ink);
  padding: 150px 0;
}
.night::before, .night::after { content: ""; position: absolute; left: 0; right: 0; height: 170px; pointer-events: none; }
.night::before { top: 0; background: linear-gradient(to bottom, var(--sand-3), rgba(234, 220, 193, 0)); }
.night::after { bottom: 0; background: linear-gradient(to top, var(--sand-3), rgba(234, 220, 193, 0)); }
.night .kicker { color: #ff8a8f; }
.night a { color: #ffb3a8; }

/* ---------- the Pass: its painted frame, with the words written inside ----------
   The panel inside the frame spans 31%-69% across and 12%-52% down the picture. */
.pass-card { position: relative; width: min(540px, 100%); margin: 0 auto; container-type: inline-size; }
.pass-card img { width: 100%; }
.pass-words {
  position: absolute; left: 31%; right: 31%; top: 15%; height: 36%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #6e5226;
}
.pass-words strong {
  font-family: var(--hand); font-weight: normal; letter-spacing: 0.04em;
  font-size: 6.2cqi; line-height: 1.05; margin-bottom: 0.35em;
}
.pass-words span { font-family: var(--hand); font-size: 2.75cqi; line-height: 1.55; white-space: nowrap; }

/* ---------- facts table, for people and for machines ---------- */
.facts { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; font-size: 1.18rem; }
.facts th, .facts td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 32%; font-weight: normal; color: var(--ink-soft); }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 10px; padding: 2px 20px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 0; font-size: 1.35rem;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--hand); font-size: 1.7rem; color: var(--red); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-soft); font-size: 1.22rem; }

/* ---------- footer, the page ending in ink ---------- */
.to-ink { height: 120px; background: linear-gradient(to bottom, var(--sand-3), var(--ink)); }
footer { background: var(--ink); color: #d9d1c3; padding: 30px 0 40px; font-size: 1.1rem; }
footer a { color: #f1c7b9; }
.foot { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.foot h4 { font-family: var(--hand); font-weight: normal; font-size: 1.5rem; margin: 0 0 8px; color: #fff; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 4px; }

/* ---------- studio home (yukae.app) ---------- */
.studio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.app-card {
  display: block; text-decoration: none; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 22px; padding: 28px; text-align: center;
  box-shadow: 0 18px 40px rgba(40, 20, 10, 0.12); transition: transform .25s ease;
}
a.app-card:hover { transform: translateY(-4px); }
.app-card img { width: 110px; border-radius: 24px; margin: 0 auto 14px; }
.app-card h3 { font-size: 2.3rem; margin-bottom: 0.2em; }
.app-card.soon { opacity: 0.85; }
.app-card .seal {
  width: 110px; height: 110px; margin: 0 auto 14px; border-radius: 24px;
  display: grid; place-items: center; background: var(--paper-deep);
  font-size: 3.4rem; color: var(--red); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

/* ---------- appear as the page is scrolled (only when scripts run) ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- plain text pages (privacy) ---------- */
.doc { max-width: 780px; margin: 0 auto; padding: calc(min(540px, 100vw) * 0.38 + 30px) 16px 80px; }
.doc h1 { font-size: clamp(2.4rem, 7vw, 3.4rem); }
.doc h2 { font-size: 1.9rem; margin-top: 1.5em; }
