/* Rekijan Apps — site styles. Tokens match the Rekijan Apps design system. */

/* ---------- Fonts (self-hosted: no requests to Google from visitors' browsers) ---------- */
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens: dark is the default ---------- */
:root {
  --bordeaux: #7c2632;
  --creme: #f6e7b8;
  --background: #17141a;
  --surface: #221e25;
  --surface-high: #2d2830;
  --outline: #3e3842;
  --primary: #9e3845;
  --on-primary: #ffffff;
  --accent: #ddbb74;
  --text: #efe8e1;
  --text-muted: #b7ada7;
  --crit-success: #f3ce63; --crit-success-bg: #362e24;
  --success: #6cc3d6;      --success-bg: #232d34;
  --failure: #ee9a5a;      --failure-bg: #362723;
  --crit-failure: #e86a78; --crit-failure-bg: #382229;

  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 48px; --space-6: 96px;
  --radius-s: 8px; --radius-m: 16px; --radius-l: 24px; --radius-pill: 999px;
  --wrap: 1120px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --background: #f5f0e8; --surface: #ffffff; --surface-high: #ece4d8; --outline: #dcd1c2;
    --primary: #7c2632; --accent: #8a661c; --text: #1e191b; --text-muted: #5c5350;
    --crit-success: #7a5a00; --crit-success-bg: #f6e7b8;
    --success: #185f70;      --success-bg: #d6ecf1;
    --failure: #9a4710;      --failure-bg: #f8dfcb;
    --crit-failure: #8c1d2c; --crit-failure-bg: #f4d3d7;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --background: #f5f0e8; --surface: #ffffff; --surface-high: #ece4d8; --outline: #dcd1c2;
  --primary: #7c2632; --accent: #8a661c; --text: #1e191b; --text-muted: #5c5350;
  --crit-success: #7a5a00; --crit-success-bg: #f6e7b8;
  --success: #185f70;      --success-bg: #d6ecf1;
  --failure: #9a4710;      --failure-bg: #f8dfcb;
  --crit-failure: #8c1d2c; --crit-failure-bg: #f4d3d7;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 400 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--space-3); }
@media (min-width: 720px) { .wrap { padding: 0 var(--space-4); } }
.is-display { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: var(--radius-s); z-index: 10; }
.skip-link:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--outline);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 64px; }
.wordmark { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: var(--space-1); }
.site-nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 10px; border-radius: var(--radius-s); }
.site-nav a:hover { color: var(--text); background: var(--surface-high); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: var(--space-1);
  border: 1px solid var(--text-muted); border-radius: var(--radius-pill); background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle.is-light .icon-sun { display: none; }
.theme-toggle.is-light .icon-moon { display: block; }
@media (max-width: 480px) {
  .site-nav a[href^="mailto"] { display: none; }
  .site-nav a { padding: 8px 6px; }
}

/* ---------- Buttons and badges ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary);
  font-weight: 700; font-size: 16px; text-decoration: none; border: 2px solid transparent;
}
.button:hover { filter: brightness(1.1); }
.button--light { background: var(--creme); color: var(--bordeaux); }
.button--ghost { background: transparent; color: var(--creme); border-color: var(--creme); }
.play-badge { display: inline-block; border-radius: 8px; }
.play-badge img { height: auto; }

.status { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 12px; border-radius: var(--radius-pill); }
.status--released { background: var(--success-bg); color: var(--success); }
.status--development { background: var(--crit-success-bg); color: var(--crit-success); }
.status--discontinued { background: var(--surface-high); color: var(--text-muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--bordeaux); color: var(--creme);
  padding: var(--space-5) 0 calc(var(--space-6) + var(--space-5));
}
.hero__art {
  position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  width: 480px; height: auto; opacity: 0.22;
  fill: none; stroke: var(--creme); stroke-width: 10; stroke-linejoin: round; stroke-linecap: round;
}
.hero__inner { position: relative; }
.hero__eyebrow { font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.hero__title { font-size: clamp(48px, 10vw, 104px); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; margin: var(--space-2) 0 var(--space-4); }
.hero__lead { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
@media (min-width: 900px) { .hero { padding-top: var(--space-6); } .hero__art { right: 4%; width: 400px; opacity: 0.3; } }
@media (max-width: 600px) { .hero__art { width: 340px; right: -140px; opacity: 0.16; } }

/* ---------- Featured ---------- */
.featured { margin-top: calc(-1 * var(--space-6)); position: relative; }
.featured__card {
  display: grid; gap: var(--space-4); align-items: center;
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-l);
  padding: var(--space-4); box-shadow: 0 20px 50px -24px rgb(0 0 0 / 0.45);
}
@media (min-width: 900px) { .featured__card { grid-template-columns: 1fr 1.15fr; padding: var(--space-5); gap: var(--space-5); } }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: var(--space-2); }
.featured__title { font-size: clamp(32px, 5vw, 48px); color: var(--accent); margin-bottom: var(--space-2); }
.featured__lead { font-size: 19px; font-weight: 600; }
.featured__text p { color: var(--text-muted); }
.featured__text .featured__lead { color: var(--text); }
.featured__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }

.degrees { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.degree { display: inline-flex; align-items: center; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: var(--radius-pill); }
.degree--crit-success { background: var(--crit-success-bg); color: var(--crit-success); }
.degree--success { background: var(--success-bg); color: var(--success); }
.degree--failure { background: var(--failure-bg); color: var(--failure); }
.degree--crit-failure { background: var(--crit-failure-bg); color: var(--crit-failure); }

/* ---------- Apps ---------- */
.apps { padding-top: var(--space-6); }
.section-heading { font-size: clamp(30px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-4); }
.group-heading { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin: var(--space-5) 0 var(--space-3); }
.apps .section-heading + .group-heading { margin-top: 0; }
.app-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.app-card {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--outline);
  color: var(--text); text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.app-card:hover { transform: translateY(-2px); border-color: var(--text-muted); }
.app-card__body { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.app-card__name { font-weight: 800; font-size: 19px; line-height: 1.25; }
.app-card__name.is-display { font-size: 19px; color: var(--accent); }
.app-card__tagline { color: var(--text-muted); font-size: 15px; line-height: 1.5; }

.app-icon { flex: none; width: 64px; height: 64px; border-radius: 16px; }
.app-icon--placeholder {
  display: grid; place-items: center; background: var(--bordeaux); color: var(--creme);
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.04em;
}
.app-icon--lg { width: 96px; height: 96px; border-radius: 24px; font-size: 30px; }

.retired { margin-top: var(--space-5); border-top: 1px solid var(--outline); padding-top: var(--space-3); }
.retired summary { cursor: pointer; font-weight: 700; color: var(--text-muted); padding: var(--space-2) 0; }
.retired ul { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: 4px; }
.retired li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 8px 0; border-bottom: 1px solid var(--outline); }
.retired li span { color: var(--text-muted); font-size: 15px; }

/* ---------- About ---------- */
.about { display: grid; gap: var(--space-3); padding-top: var(--space-6); padding-bottom: var(--space-6); }
@media (min-width: 900px) { .about { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.about__side { display: grid; gap: var(--space-3); }
.card { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-m); padding: var(--space-4); }
@media (min-width: 720px) { .about__main.card { padding: var(--space-5); } }
.card-title { font-size: 18px; font-weight: 800; margin-bottom: var(--space-3); }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.link-list a { font-weight: 700; }
.link-list span { display: block; color: var(--text-muted); font-size: 15px; line-height: 1.5; margin-top: 2px; }

/* ---------- App page ---------- */
.app-hero { background: var(--bordeaux); color: var(--creme); padding: var(--space-4) 0 var(--space-5); }
.app-hero .back-link { color: var(--creme); }
.back-link { display: inline-block; font-weight: 700; font-size: 15px; text-decoration: none; margin-bottom: var(--space-4); }
.back-link:hover { text-decoration: underline; }
.app-hero__head { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); }
.app-hero__head .app-icon--placeholder { background: var(--creme); color: var(--bordeaux); }
.app-hero__head img.app-icon { box-shadow: 0 0 0 2px rgb(246 231 184 / 0.55), 0 12px 30px -10px rgb(0 0 0 / 0.5); }
.app-hero__title { font-size: clamp(36px, 6vw, 60px); font-weight: 800; letter-spacing: -0.02em; margin: var(--space-2) 0; }
.app-hero__title.is-display { letter-spacing: 0.01em; }
.app-hero__tagline { font-size: 19px; max-width: 36em; opacity: 0.92; }

.app-body { display: grid; gap: var(--space-4); padding-top: var(--space-5); padding-bottom: var(--space-6); }
@media (min-width: 900px) { .app-body { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.app-body__text { display: grid; gap: var(--space-3); }
.section-title { font-size: 22px; font-weight: 800; margin-bottom: var(--space-3); }
.feature-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.feature-list li { position: relative; padding-left: 28px; }
.feature-list li::before {
  content: ""; position: absolute; left: 2px; top: 8px; width: 10px; height: 10px;
  background: var(--accent); transform: rotate(45deg); border-radius: 2px;
}
.feature-list--planned li::before { background: transparent; border: 2px solid var(--accent); }
.app-body__meta { color: var(--text-muted); font-size: 15px; padding: 0 var(--space-1); }
.app-body__shots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); align-items: start; }
.app-body__shots .shot--tablet { grid-column: 1 / -1; }
.app-body__shots .shot--phone:only-child { grid-column: 1 / -1; justify-self: center; max-width: 320px; }

/* ---------- Screenshots ---------- */
.shot { margin: 0; }
.shot__link { display: block; position: relative; border-radius: var(--radius-m); cursor: zoom-in; }
.shot img { width: 100%; border-radius: var(--radius-m); border: 1px solid var(--outline); background: var(--surface); }
.shot__link::after {
  content: ""; position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: var(--radius-pill);
  background: rgb(23 20 26 / 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6e7b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0; transition: opacity .15s ease;
}
.shot__link:hover::after, .shot__link:focus-visible::after { opacity: 1; }
@media (hover: none) { .shot__link::after { opacity: 1; } }

/* Show the screenshot that matches the theme. Dark is the default. */
.only-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .only-light { display: block; }
  :root:not([data-theme="dark"]) .only-dark { display: none; }
}
:root[data-theme="light"] .only-light { display: block; }
:root[data-theme="light"] .only-dark { display: none; }

/* Enlarged screenshot */
.zoom { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.zoom::backdrop { background: rgb(10 8 12 / 0.88); }
.zoom__inner { width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 16px 16px; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-m); }
.zoom__close {
  position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid rgb(246 231 184 / 0.5); background: rgb(23 20 26 / 0.8); color: var(--creme); font: 700 22px/1 var(--font-sans); cursor: pointer;
}

/* ---------- Policy pages ---------- */
.policy { padding-top: var(--space-4); padding-bottom: var(--space-6); max-width: 820px; }
.policy__card { padding: var(--space-4); }
@media (min-width: 720px) { .policy__card { padding: var(--space-5); } }
.policy__title { font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-2); }
.policy__date { color: var(--text-muted); }
.policy h2 { font-size: 20px; font-weight: 800; margin: var(--space-5) 0 var(--space-2); }
.policy ul { padding-left: 1.2em; margin: 0 0 var(--space-3); }
.policy li { margin-bottom: 6px; }
.policy__note { color: var(--text-muted); margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--outline); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bordeaux); color: var(--creme); padding: var(--space-5) 0 var(--space-4); }
.site-footer a { color: var(--creme); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); }
.wordmark--footer { color: var(--creme); font-size: 28px; margin: 0 0 var(--space-1); }
.site-footer__line { opacity: 0.9; }
.site-footer__links { display: grid; gap: var(--space-2); align-content: start; font-weight: 600; }
.site-footer__legal { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid rgb(246 231 184 / 0.3); font-size: 14px; opacity: 0.85; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }
.site-footer__legal p { margin: 0; }

/* "Contact" in the header scrolls to the footer and highlights the e-mail address. */
.contact-email { border-radius: var(--radius-pill); padding: 4px 10px; margin: -4px -10px; }
.contact-email.is-highlighted { animation: contact-highlight 2.4s ease-out; }
@keyframes contact-highlight {
  0%, 15%, 45% { background: var(--creme); color: var(--bordeaux); box-shadow: 0 0 0 6px rgb(246 231 184 / 0.35); }
  30%          { background: var(--creme); color: var(--bordeaux); box-shadow: 0 0 0 0 rgb(246 231 184 / 0); }
  100%         { background: transparent; color: var(--creme); box-shadow: 0 0 0 0 rgb(246 231 184 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  .contact-email.is-highlighted { animation: none; background: var(--creme); color: var(--bordeaux); }
}