/* ==========================================================================
   Yume Raifu — institutional site
   Direction: "Cinematic night, paper and golden light"
   Palette is provisional (see README). Contrast ratios noted next to tokens.
   ========================================================================== */

/* Self-hosted fonts (SIL Open Font License 1.1, see /assets/fonts/LICENSES.txt). Latin subset: covers EN and PT. */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/cormorant-garamond-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/cormorant-garamond-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("/assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-600.woff2") format("woff2"); }

:root {
  /* Core palette */
  --night: #140E11;        /* deepest background (footer) */
  --ink: #1C1418;          /* reddish black — main dark background */
  --graphite: #292326;     /* raised dark surfaces */
  --red: #8B1E2D;          /* deep red — surfaces, accents on light */
  --red-deep: #5E1420;     /* darker red for gradients */
  --gold: #C9A24D;         /* aged gold — ONLY on dark (7.5:1 on --ink) */
  --gold-soft: #E3C784;    /* hover state on dark */
  --gold-on-light: #7A5C1E;/* gold for ivory backgrounds (5.5:1) */
  --ivory: #F7F1E7;        /* paper */
  --ivory-2: #EFE6D6;      /* raised paper */

  /* Text */
  --text-on-dark: #F7F1E7;     /* 16.1:1 on --ink */
  --muted-on-dark: #CFC3B6;    /* 10.4:1 on --ink */
  --text-on-light: #1C1418;    /* 16.1:1 on --ivory */
  --muted-on-light: #5C4F52;   /* 6.9:1 on --ivory */

  /* Type */
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(5rem, 11vw, 9rem);
  --radius: 999px;
  --header-h: 84px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}
.on-light :focus-visible { outline-color: var(--red); }

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

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 100;
  background: var(--gold);
  color: var(--ink);
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-body);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-soft); }

.btn--ghost { border-color: rgba(247, 241, 231, .55); color: var(--text-on-dark); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

.btn--red { background: var(--red); color: var(--ivory); }
.btn--red:hover { background: var(--red-deep); }

.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: absolute;          /* no-JS: sits on top of the hero, scrolls away */
  inset: 0 0 auto 0;
  z-index: 50;
  color: var(--text-on-dark);
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease), backdrop-filter .35s var(--ease);
}
.js .site-header { position: fixed; }

.site-header.is-solid,
.site-header.is-open {
  background: rgba(20, 14, 17, .92);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 1px 0 rgba(201, 162, 77, .22);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

/* Typographic logo placeholder — replace with the approved logo file */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}
.wordmark__name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.wordmark__rule {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: .35rem;
  background: linear-gradient(90deg, var(--gold), rgba(201, 162, 77, 0));
}

.main-nav { margin-inline: auto; }
.main-nav ul {
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  list-style: none;
  margin: 0; padding: 0;
}
.main-nav ul a {
  position: relative;
  display: inline-block;
  padding: .5rem 0;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--text-on-dark);
}
.main-nav ul a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .2rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.main-nav ul a:hover::after,
.main-nav ul a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav ul a:hover { color: var(--gold-soft); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-cta { min-height: 44px; padding: .55rem 1.3rem; font-size: .95rem; }

/* Language switch EN | PT */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgba(247, 241, 231, .45);
  border-radius: var(--radius);
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 0 .7rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--text-on-dark);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.lang-switch a:hover { color: var(--gold-soft); }
.lang-switch a[aria-current="true"] {
  background: var(--ivory);
  color: var(--ink);
}

.menu-toggle { display: none; }

/* ---------- Mobile header ---------- */
@media (max-width: 900px) {
  :root { --header-h: 72px; }

  .wordmark__name { font-size: 1.5rem; }
  .header-inner { flex-wrap: wrap; gap: .75rem 1rem; }
  .header-actions { margin-left: auto; gap: .6rem; }
  .header-cta { display: none; }

  /* No-JS fallback: nav shows as a wrapped row under the logo */
  .main-nav { order: 3; width: 100%; margin: 0 0 .75rem; }
  .main-nav ul { gap: 1.5rem; flex-wrap: wrap; }

  /* With JS: collapsible panel */
  .js .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    padding: 0;
    border: 1px solid rgba(247, 241, 231, .45);
    border-radius: 50%;
    background: transparent;
    color: var(--text-on-dark);
    cursor: pointer;
  }
  .menu-toggle__bars,
  .menu-toggle__bars::before,
  .menu-toggle__bars::after {
    display: block;
    width: 18px; height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s;
  }
  .menu-toggle__bars { position: relative; }
  .menu-toggle__bars::before,
  .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle__bars::before { top: -6px; }
  .menu-toggle__bars::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

  .js .main-nav {
    display: none;
    order: 3;
    width: 100%;
    margin: 0;
    padding: .5rem 0 2rem;
  }
  .js .site-header.is-open .main-nav { display: block; }
  .js .main-nav ul { flex-direction: column; gap: 0; }
  .js .main-nav li { border-bottom: 1px solid rgba(201, 162, 77, .2); }
  .js .main-nav ul a {
    display: block;
    padding: 1rem 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
  }
  .js .main-nav ul a::after { display: none; }
  .mobile-cta { margin-top: 1.5rem; width: 100%; }
}
@media (min-width: 901px) {
  .main-nav .mobile-cta { display: none; }
}
@media (max-width: 380px) {
  .lang-switch a { min-width: 40px; padding: 0 .5rem; }
  .wordmark__name { font-size: 1.35rem; }
}

/* ---------- Hero ---------- */
/* Hero: the artwork (moon + portal) sits ABOVE the text on phones and tall windows, and BEHIND the text on
   wide screens (aspect ratio >= 8:5). Text and buttons are always real HTML. */
.hero {
  --art-h: 100vw;                       /* height of the artwork area in the stacked layout */
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + var(--art-h) - 3.5rem) 0 clamp(3rem, 7vw, 4.5rem);
  overflow: hidden;
  background: var(--ink);
}
.hero__media {
  position: absolute;
  top: var(--header-h); left: 0; right: 0;   /* art starts below the header so the moon is never covered by the menu */
  height: var(--art-h);
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
/* Contrast layers: a soft top shade for the header, and a fade into the page color under the artwork */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 14, 17, .6) 0, rgba(20, 14, 17, 0) 7rem),
    linear-gradient(180deg, rgba(20, 14, 17, 0) calc(var(--header-h) + var(--art-h) - 10rem), var(--ink) calc(var(--header-h) + var(--art-h) - 1rem));
}
@media (min-width: 721px) {
  .hero { --art-h: min(56vw, 520px); }
  .hero__media img { object-position: 72% 0%; }
}
/* Wide screens: artwork behind the text. The left side of the art is already dark, so the shade is light. */
@media (min-width: 1001px) and (min-aspect-ratio: 8/5) {
  .hero { min-height: 100vh; min-height: 100svh; padding: calc(var(--header-h) + 3rem) 0 clamp(4rem, 9vh, 7rem); }
  .hero__media { inset: var(--header-h) 0 0 0; height: auto; }   /* art starts below the header so the moon never sits under the menu */
  .hero__media img { object-position: 72% 30%; }
  .hero::before {
    background:
      linear-gradient(90deg, rgba(20, 14, 17, .55) 0%, rgba(20, 14, 17, .25) 40%, rgba(20, 14, 17, 0) 62%),
      linear-gradient(0deg, rgba(20, 14, 17, .75) 0%, rgba(20, 14, 17, 0) 40%),
      linear-gradient(180deg, rgba(20, 14, 17, .55) 0%, rgba(20, 14, 17, 0) 14%);
  }
  .hero__content { max-width: 38rem; }
}
.hero__content { max-width: 46rem; text-shadow: 0 1px 18px rgba(20, 14, 17, .65); }
.motion-ok .hero__content { animation: hero-in 1.1s var(--ease) both; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 1.5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: currentColor;
}
.on-light .eyebrow { color: var(--gold-on-light); }

.hero h1 {
  font-size: clamp(2.75rem, 5.6vw, 5.5rem);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero__lead {
  max-width: 34rem;
  font-size: clamp(1.1rem, .5vw + 1rem, 1.3rem);
  color: var(--muted-on-dark);
  margin-bottom: 2.25rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 720px) {
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); position: relative; }
.section--light { background: var(--ivory); color: var(--text-on-light); }
.section--dark { background: var(--ink); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 46rem;
}
.section-head h2 {
  font-size: clamp(2.4rem, 4.8vw, 4rem);
}
.section-head .intro { color: var(--muted-on-dark); font-size: 1.15em; }
.on-light .section-head .intro { color: var(--muted-on-light); }

.section-index {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
}
.on-light .section-index { color: var(--gold-on-light); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 6rem);
}
@media (min-width: 960px) {
  .about-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: start; }
}
.about-text { font-size: 1.1em; color: var(--muted-on-light); }
.about-text p:first-child {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  line-height: 1.35;
  color: var(--text-on-light);
}

.pillars-title {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-on-light);
  margin-bottom: 1rem;
}
.pillars { list-style: none; margin: 0; padding: 0; }
.pillars li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(122, 92, 30, .35);
}
.pillars li:last-child { border-bottom: 1px solid rgba(122, 92, 30, .35); }
.pillars .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold-on-light);
  line-height: 1.2;
}
.pillars h4 { font-size: 1.75rem; margin-bottom: .35rem; color: var(--text-on-light); }
.pillars p { color: var(--muted-on-light); font-size: .98em; }

/* Products */
.products { overflow: hidden; }
.products::before {
  /* soft red glow behind the feature */
  content: "";
  position: absolute;
  width: 70vw; height: 70vw;
  max-width: 900px; max-height: 900px;
  right: -20vw; top: 10%;
  background: radial-gradient(circle, rgba(139, 30, 45, .45), rgba(139, 30, 45, 0) 65%);
  pointer-events: none;
}
.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

.media-placeholder {
  position: relative;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  padding: 2rem;
  border-radius: 4px;
  background:
    radial-gradient(circle at 70% 25%, rgba(201, 162, 77, .35), rgba(201, 162, 77, 0) 45%),
    linear-gradient(160deg, var(--red) 0%, var(--red-deep) 55%, var(--night) 100%);
  text-align: center;
}
.media-placeholder::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201, 162, 77, .55);
  pointer-events: none;
}
.media-placeholder span {
  max-width: 16rem;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ivory);
  border: 1px dashed rgba(201, 162, 77, .8);
  padding: .6rem 1rem;
  background: rgba(20, 14, 17, .45);
}
.feature__media img { width: 100%; height: auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .9rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(201, 162, 77, .6);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 77, .2);
}

.feature__body h3 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin-bottom: 1.5rem;
}
.feature__body h3 .dash { color: var(--gold); }
.feature__body > p:not(.badge) { color: var(--muted-on-dark); font-size: 1.1em; max-width: 36rem; }
.feature__cta { margin-top: 2rem; }

/* Project facts — grid on desktop, swipeable row on small screens */
.facts { margin-top: clamp(3.5rem, 7vw, 6rem); position: relative; }
.facts__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.facts__head h3 {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}
.facts__controls { display: none; gap: .5rem; }
.facts__controls button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 231, .45);
  background: transparent;
  color: var(--text-on-dark);
  font-size: 1.1rem;
  cursor: pointer;
}
.facts__controls button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-soft); }
.facts__controls button:disabled { opacity: .35; cursor: default; }

.facts__list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.fact {
  padding: 1.75rem 1.5rem;
  background: rgba(41, 35, 38, .75);
  border: 1px solid rgba(201, 162, 77, .2);
  border-radius: 4px;
}
.fact h4 {
  font-size: 1.5rem;
  margin-bottom: .6rem;
  color: var(--ivory);
}
.fact p { color: var(--muted-on-dark); font-size: .98rem; }

@media (max-width: 1000px) {
  .facts__list {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    gap: 1rem;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
  }
  .fact { flex: 0 0 min(78%, 20rem); scroll-snap-align: start; }
  .js .facts__controls { display: flex; }
}

.future-note {
  margin-top: 3rem;
  font-size: .95rem;
  color: var(--muted-on-dark);
}

/* Contact */
.contact {
  background:
    radial-gradient(ellipse at 15% 100%, rgba(139, 30, 45, .55), rgba(139, 30, 45, 0) 60%),
    var(--graphite);
  text-align: left;
}
.contact__inner { max-width: 52rem; }
.contact h2 { font-size: clamp(2.8rem, 6vw, 5rem); margin-bottom: 1.25rem; }
.contact p:not(.eyebrow) { color: var(--muted-on-dark); font-size: 1.15em; max-width: 34rem; }
.email-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 3.25rem);
  font-weight: 500;
  color: var(--gold);
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: .15em;
  transition: color .25s var(--ease), background-size .35s var(--ease);
}
.email-link:hover { color: var(--gold-soft); background-size: 40% 1px; }

/* ---------- Blog page ---------- */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(4rem, 10vw, 8rem)) 0 clamp(4rem, 9vw, 7rem);
  background:
    radial-gradient(ellipse at 85% 0%, rgba(139, 30, 45, .55), rgba(139, 30, 45, 0) 55%),
    var(--ink);
  border-bottom: 1px solid rgba(201, 162, 77, .2);
}
.page-hero h1 { font-size: clamp(3.25rem, 8vw, 6.5rem); margin-bottom: 1.25rem; }
.page-hero .lead { font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem); font-family: var(--font-display); color: var(--ivory); max-width: 36rem; }

.coming-soon {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  max-width: 44rem;
}
.coming-soon p { color: var(--muted-on-light); font-size: 1.1em; }
.coming-soon p a { color: var(--red); text-underline-offset: 4px; }
.coming-soon .actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.btn--outline-dark { border-color: rgba(28, 20, 24, .5); color: var(--text-on-light); }
.btn--outline-dark:hover { border-color: var(--red); color: var(--red); }

/* ---------- Shared content helpers ---------- */
.narrow { max-width: 46rem; }
.lede {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  line-height: 1.35;
}
.section--dark .lede, .app-section .lede { color: var(--ivory); }
.on-light .lede { color: var(--text-on-light); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--media-first > :first-child { order: 0; }
}
.split h2, .narrow h2 { font-size: clamp(2.3rem, 4.5vw, 3.6rem); margin-bottom: 1.5rem; }
.split p:not(.eyebrow):not(.lede), .narrow p:not(.eyebrow):not(.lede) { font-size: 1.08em; }
.on-light .split p:not(.eyebrow), .on-light .narrow p:not(.eyebrow) { color: var(--muted-on-light); }
.app-section .split p:not(.eyebrow):not(.lede), .app-section .narrow p:not(.eyebrow):not(.lede) { color: var(--muted-on-dark); }
.on-light .narrow p a, .prose a { color: var(--red); text-underline-offset: 4px; }

figure { margin: 0; }

/* ---------- App page (stronger red & gold) ---------- */
.theme-app { background: var(--ink); }

.app-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + clamp(3rem, 8vw, 6rem)) 0 clamp(4rem, 9vw, 7rem);
  background:
    radial-gradient(circle at 78% 30%, rgba(201, 162, 77, .28), rgba(201, 162, 77, 0) 38%),
    radial-gradient(ellipse at 10% 100%, rgba(94, 20, 32, .9), rgba(94, 20, 32, 0) 60%),
    linear-gradient(160deg, #4A1019 0%, var(--red-deep) 40%, var(--ink) 100%);
  border-bottom: 1px solid rgba(201, 162, 77, .35);
}
.app-hero::after {
  /* thin gold horizon lines */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 5%;
  height: 40px;
  background: repeating-linear-gradient(180deg, rgba(201, 162, 77, .18) 0 1px, transparent 1px 14px);
  pointer-events: none;
}
.app-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) {
  .app-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.app-hero h1 {
  font-size: clamp(3rem, 6.5vw, 5.75rem);
  line-height: 1;
  margin-bottom: 1.5rem;
}
.app-hero__brand {
  display: block;
  font-size: .42em;
  font-style: italic;
  color: var(--gold);
  letter-spacing: .02em;
  margin-bottom: .35em;
}
.app-hero__lead {
  max-width: 34rem;
  font-size: clamp(1.1rem, .5vw + 1rem, 1.3rem);
  color: var(--ivory);
  opacity: .92;
  margin-bottom: 2.25rem;
}
.app-hero__media { max-width: 26rem; width: 100%; justify-self: center; }
.app-hero .badge { margin-bottom: 1.25rem; }
.app-hero .eyebrow { display: flex; }

.media-placeholder--cover,
.media-placeholder--kiyomi { box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.media-placeholder--kiyomi {
  background:
    radial-gradient(circle at 50% 30%, rgba(247, 241, 231, .25), rgba(247, 241, 231, 0) 35%),
    linear-gradient(170deg, var(--graphite) 0%, var(--red-deep) 100%);
}
.kiyomi-media { max-width: 30rem; width: 100%; justify-self: center; }

.app-section { background: var(--ink); }
.app-section--red {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 77, .18), rgba(201, 162, 77, 0) 55%),
    linear-gradient(180deg, var(--red-deep) 0%, #3A1219 100%);
}

/* Card image slots (2:3, like the app's card art) */
.card-slots {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.75rem, 2vw, 1.25rem);
}
.card-slots li:nth-child(2) { transform: translateY(-1.5rem); }
.card-slot {
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 35%, rgba(201, 162, 77, .45), rgba(201, 162, 77, 0) 40%),
    linear-gradient(170deg, var(--red) 0%, var(--red-deep) 100%);
  border: 1px solid rgba(122, 92, 30, .6);
  box-shadow: inset 0 0 0 6px rgba(247, 241, 231, .08), 0 14px 30px rgba(28, 20, 24, .25);
}
.card-slot span, .phone-slot span {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ivory);
  border: 1px dashed rgba(201, 162, 77, .8);
  padding: .35rem .6rem;
  background: rgba(20, 14, 17, .45);
  text-align: center;
}

/* Phone screenshot slots */
.phone-slots {
  list-style: none;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  max-width: 42rem;
}
.phone-slot {
  aspect-ratio: 9 / 19.5;
  display: grid;
  place-items: center;
  border-radius: clamp(18px, 3vw, 32px);
  border: 1px solid rgba(201, 162, 77, .55);
  background: linear-gradient(180deg, rgba(28, 20, 24, .9), rgba(28, 20, 24, .7));
  box-shadow: inset 0 0 0 6px rgba(20, 14, 17, .9), 0 24px 50px rgba(0, 0, 0, .35);
}
.slot-note { margin-top: 1.5rem; font-size: .95rem; color: var(--muted-on-dark); }

@media (max-width: 640px) {
  .phone-slots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 1rem;
  }
  .phone-slots li { flex: 0 0 62%; scroll-snap-align: center; }
}

/* ---------- Prose pages (support, legal) ---------- */
.prose { color: var(--muted-on-light); font-size: 1.05em; }
.prose > * { max-width: 44rem; }
.prose h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: var(--text-on-light);
  margin: 2.75rem 0 1rem;
}
.prose ul { padding-left: 1.25rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--text-on-light); }
.back-links { margin-top: 3rem; }

.badge--light {
  color: var(--gold-on-light);
  border-color: rgba(122, 92, 30, .55);
  margin-bottom: 0;
}
.badge--light::before { background: var(--gold-on-light); box-shadow: 0 0 0 4px rgba(122, 92, 30, .15); }

/* Draft markers (preview only — draft pages are left out of the production build) */
.draft-banner {
  position: relative;
  z-index: 40;
  margin-top: var(--header-h);
  padding: .85rem var(--gutter);
  background: repeating-linear-gradient(135deg, #F3D27A 0 14px, #EDC860 14px 28px);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}
.draft-banner + .page-hero { padding-top: clamp(3rem, 8vw, 5rem); }
mark.todo {
  background: #FBE7A8;
  color: var(--ink);
  padding: .05em .3em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.todo-note {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--gold-on-light);
  background: var(--ivory-2);
  color: var(--text-on-light);
  font-size: .95rem;
  margin-bottom: 2rem;
}

/* Preview index */
.preview-link {
  color: var(--gold);
  font-size: .85rem;
  border: 1px dashed rgba(201, 162, 77, .6);
  border-radius: var(--radius);
  padding: .25rem .75rem;
  text-decoration: none;
}
.preview-index { min-height: 100vh; }
.preview-index h1 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1rem; }
.preview-index .intro { color: var(--muted-on-light); max-width: 46rem; margin-bottom: 2.5rem; }
.preview-index a { color: var(--red); }
.table-wrap { overflow-x: auto; }
.preview-index table { width: 100%; border-collapse: collapse; font-size: .98rem; min-width: 640px; }
.preview-index th, .preview-index td { text-align: left; padding: .9rem .75rem; border-bottom: 1px solid rgba(122, 92, 30, .3); vertical-align: top; }
.preview-index thead th { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-on-light); }
.preview-index small { color: var(--muted-on-light); }
.status { display: inline-block; padding: .15rem .6rem; border-radius: var(--radius); font-size: .82rem; font-weight: 600; }
.status--ok { background: #DCEBD8; color: #24461F; }
.status--review { background: #E7E0F2; color: #3B2A5C; }
.status--warn { background: #F7E3C2; color: #5C3B0B; }
.status--draft { background: #F6D5D8; color: #6B1420; }

/* ---------- Real artwork (cards, card back, Kiyomi) ---------- */
.art-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(201, 162, 77, .35);
}
.app-hero__media { max-width: 24rem; }
.feature__media { max-width: 21rem; width: 100%; justify-self: center; }
@media (max-width: 720px) {
  .app-hero__media, .feature__media { max-width: 15rem; }
}

/* Cards are shown whole (2:3). Number and name are real text placed over the art's empty areas. */
.card-art-row {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.6rem, 2vw, 1.25rem);
}
.card-art-row li:nth-child(2) { transform: translateY(-1.25rem); }
.card-art {
  position: relative;
  container-type: inline-size;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(28, 20, 24, .3);
}
.card-art img { display: block; width: 100%; height: auto; border-radius: 8px; }
.card-art__num {
  position: absolute;
  left: 14.5%; top: 9.5%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13cqw;
  line-height: 1;
  color: var(--ivory);
}
.card-art__name {
  position: absolute;
  left: 50%; top: 91.5%;
  transform: translate(-50%, -50%);
  width: 84%;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 9.5cqw;
  line-height: 1;
  letter-spacing: .03em;
  color: #4A1019;
  white-space: nowrap;
}

/* Kiyomi: wide art shown whole, text below */
.kiyomi-banner { margin: 0; }
.kiyomi-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(201, 162, 77, .35);
}
.kiyomi-text { max-width: 44rem; margin-top: clamp(2rem, 5vw, 3.5rem); }
.kiyomi-text h2 { font-size: clamp(2.3rem, 4.5vw, 3.6rem); margin-bottom: 1.25rem; }
.kiyomi-text .lede { color: var(--ivory); margin-bottom: 1.1em; }
.kiyomi-text p:not(.eyebrow):not(.lede) { color: var(--muted-on-dark); font-size: 1.08em; }

/* Decorative palette strip (replaces the screenshot placeholders) */
.palette-strip {
  list-style: none;
  display: flex;
  gap: .75rem;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: 0;
}
.palette-strip li {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(201, 162, 77, .6);
}

/* ---------- Logo ---------- */
.wordmark--logo { flex-direction: row; align-items: center; gap: .7rem; }
.wordmark__symbol { width: 50px; height: auto; flex: none; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); }
.wordmark__text { display: flex; flex-direction: column; line-height: 1; }
@media (max-width: 380px) { .wordmark__symbol { width: 40px; } .wordmark--logo { gap: .5rem; } .wordmark--logo .wordmark__name { font-size: 1.25rem; } }
/* Very narrow phones (320 px): symbol only; the link keeps its accessible name "Yume Raifu" */
@media (max-width: 340px) { .wordmark__symbol { width: 44px; } .wordmark--logo .wordmark__text { display: none; } }
.wordmark__name { white-space: nowrap; }

/* Footer: the original logo file, shown whole. Its transparent margins are trimmed with CSS (no re-encoding). */
.footer-logo { display: block; width: min(15rem, 70vw); margin-bottom: 1.25rem; }
.footer-logo__crop {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 962 / 1039;     /* drawing area inside the 1312 x 1199 file: x 165..1127, y 76..1115 */
  overflow: hidden;
}
.footer-logo__crop img {
  position: absolute;
  width: 136.38%;               /* 1312 / 962 */
  max-width: none;
  height: auto;
  left: -17.15%;                /* 165 / 962 */
  top: -7.31%;                  /* 76 / 1039 (percent of the box height) */
}

.legal-notice {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--gold-on-light);
  background: var(--ivory-2);
  color: var(--text-on-light);
  font-size: .95rem;
  margin-bottom: 2rem;
}
/* Legal tables inside prose pages */
.prose .table-wrap { max-width: 56rem; margin: 0 0 1.5rem; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 30rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: .7rem .75rem; border-bottom: 1px solid rgba(122, 92, 30, .3); }
.legal-table thead th { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-on-light); }

/* Wide screens: header and hero use more of the width (other sections keep the reading column) */
.site-header .container,
.hero .container { max-width: 1920px; padding-inline: clamp(1.25rem, 4vw, 4.5rem); }

/* ---------- Touch targets (min 44 × 44 px) and cross-browser details ---------- */
.wordmark { min-height: 44px; justify-content: center; }
.lang-switch a { min-height: 44px; min-width: 44px; }
@media (max-width: 380px) { .lang-switch a { min-width: 44px; padding: 0 .55rem; } }
.footer-nav a { padding: .7rem 0; min-height: 44px; }
.footer-nav ul { gap: 0; }
.footer-email { display: inline-flex; align-items: center; min-height: 44px; }
.back-to-top, .preview-link { display: inline-flex; align-items: center; min-height: 44px; }
.email-link { min-height: 44px; }
.facts__controls button, .menu-toggle { min-width: 44px; min-height: 44px; }
/* Safari/iOS: avoid sticky hover styles on touch and the 300 ms tap highlight flash */
a, button { -webkit-tap-highlight-color: rgba(201, 162, 77, .25); }
@media (hover: none) { .btn:hover { transform: none; } }
/* Firefox/Safari fallback for browsers without 100svh */
@supports not (height: 100svh) { .hero { min-height: max(640px, 100vh); } }
/* Fallback for browsers without container query units (older Safari/Firefox): fixed sizes close to the cqw values */
@supports not (font-size: 1cqw) {
  .card-art__num { font-size: 1.6rem; }
  .card-art__name { font-size: 1rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--night);
  color: var(--muted-on-dark);
  padding: clamp(4rem, 8vw, 6rem) 0 2rem;
  font-size: 1rem;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid rgba(201, 162, 77, .3);
}
/* Brand block on the left, the four link columns beside it (stacked on phones) */
@media (min-width: 900px) {
  .footer-top { grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
}
.footer-brand .wordmark { color: var(--ivory); margin-bottom: 1.25rem; }
.footer-brand .wordmark__name { font-size: 2.25rem; }
.footer-brand p { max-width: 26rem; }
.footer-email {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: var(--gold);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.footer-email:hover { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 2rem;
  padding: .5rem 0 0;
}
@media (min-width: 800px) {
  .footer-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.footer-nav h2 {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer-nav a {
  display: inline-block;
  padding: .3rem 0;
  color: var(--ivory);
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 241, 231, .25);
  transition: color .2s, border-color .2s;
}
.footer-nav a:hover { color: var(--gold-soft); border-color: var(--gold); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(247, 241, 231, .12);
  font-size: .92rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom .lang-switch { border-color: rgba(247, 241, 231, .3); }
.back-to-top { color: var(--muted-on-dark); text-decoration: none; }
.back-to-top:hover { color: var(--gold-soft); }

/* ---------- Reveal motion (only with JS + motion allowed) ---------- */
.js.motion-ok .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js.motion-ok .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
