/* Oneiric Diary — Legal pages (Cloudflare Pages) */

@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfairdisplay_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("/assets/fonts/nunitosans_7pt_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --od-bg: #1c1e22;
  --od-surface: #282a46;
  --od-surface-2: #323654;
  --od-accent: #3f5996;
  --od-accent-light: #5b659c;
  --od-gold: #e4c973;
  --od-text: #eae1d9;
  --od-text-muted: #c7d0e5;
  --od-text-dim: #9398bc;
  --od-border: rgba(199, 208, 229, 0.18);
  --od-max-width: 720px;
  --od-radius: 12px;
  --od-font: "Nunito Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --od-font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--od-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--od-text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(63, 89, 150, 0.35), transparent),
    var(--od-bg);
}

a {
  color: var(--od-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #f2da8e;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(28, 30, 34, 0.88);
  border-bottom: 1px solid var(--od-border);
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--od-border);
  border-radius: 999px;
  background: rgba(40, 42, 70, 0.55);
}

.lang-switch__link {
  min-width: 2.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--od-text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-align: center;
}

.lang-switch__link:hover {
  color: var(--od-text-muted);
}

.lang-switch__link--active {
  color: var(--od-bg);
  background: var(--od-gold);
}

.brand {
  display: flex;
  align-items: center;
  color: var(--od-text);
  text-decoration: none;
}

.brand__logo {
  display: block;
  height: 2.75rem;
  width: auto;
  max-width: min(220px, 58vw);
  object-fit: contain;
}

.brand__logo--icon {
  height: 2.5rem;
  max-width: 2.5rem;
}

.brand__logo--hero {
  height: auto;
  width: min(320px, 88vw);
  max-width: 100%;
  margin: 0 auto 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--od-text-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--od-gold);
}

.page {
  max-width: var(--od-max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page--wide {
  max-width: 880px;
}

.doc-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--od-border);
}

.doc-header h1 {
  margin: 0 0 0.5rem;
  font-family: var(--od-font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  color: var(--od-gold);
  line-height: 1.2;
}

.doc-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--od-text-dim);
}

.doc-meta strong {
  color: var(--od-text-muted);
}

.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: rgba(63, 89, 150, 0.22);
  border: 1px solid rgba(63, 89, 150, 0.45);
  border-radius: var(--od-radius);
  font-size: 0.92rem;
  color: var(--od-text-muted);
}

.notice--warn {
  background: rgba(228, 201, 115, 0.1);
  border-color: rgba(228, 201, 115, 0.35);
}

.legal-content h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--od-text);
  scroll-margin-top: 5rem;
}

.legal-content h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--od-text-muted);
}

.legal-content p {
  margin: 0 0 1rem;
  color: var(--od-text-muted);
}

.legal-content ul,
.legal-content ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: var(--od-text-muted);
}

.legal-content li {
  margin-bottom: 0.35rem;
}

.legal-content li::marker {
  color: var(--od-accent-light);
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  display: block;
  padding: 1.35rem 1.5rem;
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: var(--od-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(228, 201, 115, 0.45);
  transform: translateY(-2px);
  color: inherit;
}

.card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--od-gold);
}

.card__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--od-text-dim);
}

.hero h1,
.doc-header h1,
.legal-content h2,
.card__title {
  font-family: var(--od-font-display);
  font-weight: 400;
}

.hero {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--od-gold);
}

.hero p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--od-text-dim);
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.35rem;
  background: var(--od-accent);
  color: #fff !important;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--od-accent-light);
  color: #fff !important;
}

.btn--secondary {
  background: transparent;
  border: 1px solid var(--od-border);
  color: var(--od-text-muted) !important;
}

.btn--secondary:hover {
  border-color: var(--od-gold);
  color: var(--od-gold) !important;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 2.75rem;
  margin: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.85rem;
  height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--od-gold);
}

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  border-top: 1px solid var(--od-border);
  font-size: 0.85rem;
  color: var(--od-text-dim);
  text-align: center;
}

.site-footer a {
  color: var(--od-text-muted);
}

.site-footer__icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.75rem;
  opacity: 0.85;
}

.toc {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--od-surface);
  border-radius: var(--od-radius);
  border: 1px solid var(--od-border);
}

.toc__title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--od-text-dim);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.toc a {
  color: var(--od-text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--od-gold);
  text-decoration: underline;
}

/* --- Landing page --- */

body.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 70% at 15% 0%, rgba(63, 89, 150, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 60% at 100% 20%, rgba(50, 54, 84, 0.45), transparent 50%),
    linear-gradient(160deg, #171923 0%, #1c1e22 42%, #23263a 100%);
}

body.landing .site-header {
  position: relative;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}

.site-header--landing .site-header__inner--landing {
  max-width: 1180px;
  padding: 1.35rem 1.5rem 0.5rem;
  align-items: center;
}

.brand--landing {
  text-decoration: none;
}

.brand__logo--text {
  height: 2.35rem;
  width: auto;
  max-width: min(240px, 52vw);
}

.site-nav--landing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1.15rem;
  font-size: 0.92rem;
}

.site-nav--landing a {
  color: var(--od-gold);
  text-decoration: none;
}

.site-nav--landing a:hover {
  color: #f2da8e;
}

.landing-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.landing-hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  min-height: min(72vh, 760px);
}

@media (min-width: 900px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 46%);
    gap: 1.5rem 2rem;
  }
}

.landing-hero__copy {
  max-width: 34rem;
}

.landing-hero__title {
  margin: 0 0 1.25rem;
  font-family: var(--od-font-display);
  font-size: clamp(2.1rem, 4.8vw, 3.35rem);
  font-weight: 400;
  line-height: 1.12;
  color: #f5f0ea;
  letter-spacing: -0.01em;
}

.landing-hero__tagline {
  margin: 0 0 2rem;
  max-width: 30rem;
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
  color: var(--od-text-dim);
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 11.5rem;
  padding: 0.65rem 1rem 0.65rem 0.85rem;
  border: 1px solid rgba(228, 201, 115, 0.72);
  border-radius: 10px;
  background: rgba(28, 30, 34, 0.35);
  color: #f5f0ea !important;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.store-btn:hover {
  border-color: var(--od-gold);
  background: rgba(63, 89, 150, 0.22);
  color: #fff !important;
  transform: translateY(-1px);
}

.store-btn__icon {
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
}

.store-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-btn__line1 {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: rgba(234, 225, 217, 0.82);
}

.store-btn__line2 {
  font-size: 1rem;
  font-weight: 600;
}

.landing-qr {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.landing-qr__code {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  padding: 0.35rem;
  border-radius: 8px;
  background: #fff;
}

.landing-qr__hint {
  margin: 0;
  max-width: 11rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(234, 225, 217, 0.88);
}

.landing-hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.landing-hero__mockup {
  display: block;
  width: min(100%, 378px);
  height: auto;
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.45));
}

@media (min-width: 900px) {
  .landing-hero__mockup {
    width: min(100%, 414px);
    margin-left: auto;
  }
}

.site-footer--landing {
  max-width: none;
  margin-top: auto;
  padding: 0;
  border-top: 1px solid rgba(199, 208, 229, 0.12);
  background: rgba(12, 14, 18, 0.72);
  text-align: left;
}

.site-footer--landing .site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.15rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer--landing .site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-footer--landing .site-footer__icon {
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
}

.site-footer--landing .site-footer__brand p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--od-text-dim);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.35rem;
  font-size: 0.84rem;
}

.site-footer__links a {
  color: var(--od-text-dim);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--od-gold);
}

@media (max-width: 899px) {
  .site-header--landing .site-header__inner--landing {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav--landing {
    justify-content: flex-start;
  }

  .landing-hero__copy {
    max-width: none;
  }

  .landing-hero__visual {
    order: -1;
  }

  .landing-hero__mockup {
    width: min(70vw, 288px);
  }
}
