/* Zen wash showcase — inspired by mockups/07-zen.html (washi, vermillion seal, device chrome) */

:root {
  color-scheme: light dark;

  --font-sans: "Inter", system-ui, sans-serif;
  --font-display: "Noto Serif JP", "Source Serif Pro", Georgia, serif;

  --text: #1c1a18;
  --text-secondary: #6b6256;
  --text-tertiary: #8a8278;
  --primary: #b03b2a;
  --primary-muted: rgba(176, 59, 42, 0.12);
  --on-primary: #f5ebd5;
  --gold: #a8852e;
  --hairline: rgba(40, 30, 20, 0.1);
  --hairline-strong: rgba(40, 30, 20, 0.14);

  --surface: #fbf6ec;
  --surface-2: #ece4d2;
  --rice: #fbf6ec;
  --washi-base-a: #f4ede0;
  --washi-base-b: #ebdfc8;

  --page-bg: linear-gradient(160deg, #f0e6d3 0%, #d6c5a8 100%);
  --body-stack:
    radial-gradient(60% 40% at 30% 8%, rgba(176, 59, 42, 0.07), transparent 72%),
    radial-gradient(55% 45% at 78% 88%, rgba(168, 133, 46, 0.06), transparent 70%),
    linear-gradient(170deg, var(--washi-base-a) 0%, var(--washi-base-b) 100%);
  --washi-fine: repeating-linear-gradient(
    45deg,
    rgba(40, 30, 20, 0.012) 0 2px,
    transparent 2px 5px
  );
  --washi-diagonal: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(40, 30, 20, 0.022) 3px,
    rgba(40, 30, 20, 0.022) 5px
  );

  --shadow-card: 0 6px 16px -10px rgba(70, 40, 20, 0.22);
  --shadow-device: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 28px 56px -22px rgba(40, 20, 10, 0.38), 0 12px 28px -10px rgba(0, 0, 0, 0.2);
  --radius-card: 2px;
  --radius-chip: 2px;
  --max: 980px;

  --device-w: 390px;
  --device-radius: 52px;
  --device-bezel: 11px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5ebd5;
    --text-secondary: #a89f91;
    --text-tertiary: #7a7268;
    --primary: #c85848;
    --primary-muted: rgba(200, 88, 72, 0.2);
    --on-primary: #12161c;
    --gold: #c9a962;
    --hairline: rgba(245, 235, 213, 0.1);
    --hairline-strong: rgba(245, 235, 213, 0.14);

    --surface: #1e2530;
    --surface-2: #1a2029;
    --rice: #1e2530;
    --washi-base-a: #12161c;
    --washi-base-b: #161c24;

    --page-bg: linear-gradient(165deg, #0e1218 0%, #1a222c 100%);
    --body-stack:
      radial-gradient(50% 40% at 25% 12%, rgba(200, 88, 72, 0.12), transparent 65%),
      radial-gradient(45% 35% at 85% 75%, rgba(201, 169, 98, 0.08), transparent 70%),
      linear-gradient(175deg, var(--washi-base-a) 0%, var(--washi-base-b) 100%);
    --washi-fine: repeating-linear-gradient(
      45deg,
      rgba(245, 235, 213, 0.028) 0 2px,
      transparent 2px 5px
    );
    --washi-diagonal: repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 3px,
      rgba(245, 235, 213, 0.045) 3px,
      rgba(245, 235, 213, 0.045) 5px
    );

    --shadow-card: 0 8px 28px -8px rgba(0, 0, 0, 0.45);
    --shadow-device: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 0 0 1px rgba(0, 0, 0, 0.65),
      0 32px 64px -20px rgba(0, 0, 0, 0.55), 0 14px 32px -12px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image: var(--body-stack);
}

body::after {
  background-image: var(--washi-fine), var(--washi-diagonal);
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

/* ----- Header (mockup page-header tone) ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--rice) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

.nav-skip {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.nav-skip a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-chip);
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-skip a:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--hairline));
}

/* ----- Hero ----- */

.hero {
  position: relative;
  text-align: center;
  padding: 2.75rem 0 3.25rem;
}

/* Brain-in-square seal — matches app home (`sealMark` + MaterialCommunityIcons `brain`) */
.hero__seal {
  position: absolute;
  top: 1.25rem;
  right: clamp(0px, 4vw, 2.5rem);
  width: 30px;
  height: 30px;
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-3deg);
  opacity: 0.55;
  pointer-events: none;
}

.hero__seal-svg {
  display: block;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .hero__seal {
    right: 0.25rem;
    opacity: 0.35;
  }
}

.hero__eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.55em;
  color: var(--text-tertiary);
  margin-bottom: 0.85rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5.2vw, 2.85rem);
  line-height: 1.18;
  margin: 0 0 0.35rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.hero__tagline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  line-height: 1.35;
  margin: 0 0 1.1rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.hero__lead {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.chip {
  display: inline-block;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-chip);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  box-shadow: 0 2px 0 rgba(70, 40, 20, 0.04);
}

@media (prefers-color-scheme: dark) {
  .chip {
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  }
}

/* ----- Sections ----- */

main {
  padding-top: 0.5rem;
}

section {
  margin-top: 3rem;
}

.section__head {
  margin-bottom: 1.25rem;
}

section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 0.65rem;
  color: var(--text);
  letter-spacing: 0.04em;
  position: relative;
  display: inline-block;
  padding: 0 0 0.35rem 0.85rem;
  border-bottom: 1px solid var(--hairline-strong);
}

section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.35rem;
  width: 3px;
  background: var(--primary);
  opacity: 0.88;
  border-radius: 0;
}

.lead {
  color: var(--text-secondary);
  max-width: 42rem;
  margin: 0;
}

.lead + .lead {
  margin-top: 1rem;
}

.feature-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.35rem;
}

@media (min-width: 560px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.35rem 1.25rem 1.15rem;
  box-shadow: var(--shadow-card), 0 2px 0 rgba(70, 40, 20, 0.04);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
  opacity: 0.85;
  border-radius: 0;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  margin: 0 0 0.45rem;
  color: var(--text);
  letter-spacing: 0.03em;
}

.card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.rules-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: var(--text-secondary);
}

.rules-list li {
  margin-bottom: 0.55rem;
}

.rules-list strong {
  color: var(--text);
}

/* ----- Screenshots: device grid (mockup .devices / .device) ----- */

.section--screens {
  margin-top: 3.5rem;
  padding: 2rem 1.5rem 2.25rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: var(--shadow-card);
}

@media (min-width: 640px) {
  .section--screens {
    padding: 2.25rem 2rem 2.5rem;
    margin-left: 0;
    margin-right: 0;
  }
}

.section--screens .section__head {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section--screens .section__head h2 {
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.85rem;
}

.screenshots__note {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  margin: 0.75rem auto 0;
  max-width: 36rem;
  line-height: 1.55;
  text-align: center;
}

.devices-grid {
  display: grid;
  gap: 2.75rem 2rem;
  margin-top: 2.5rem;
  grid-template-columns: 1fr;
  justify-items: center;
}

@media (min-width: 620px) {
  .devices-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .devices-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem 1.75rem;
  }
}

.device-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  width: 100%;
  max-width: 400px;
}

.device-showcase figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
  margin: 0;
  padding: 0 0.25rem;
}

.device-showcase__kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.device-showcase__variant {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.04em;
}

.device-frame {
  width: min(100%, calc(var(--device-w) * 0.92));
  /* Height follows each screenshot’s intrinsic aspect — avoids letterboxing. */
  border-radius: var(--device-radius);
  padding: var(--device-bezel);
  background: linear-gradient(145deg, #242428 0%, #0a0a0c 55%, #121214 100%);
  box-shadow: var(--shadow-device);
  position: relative;
  isolation: isolate;
}

.device-frame::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 22%;
  width: 3px;
  height: 64px;
  background: linear-gradient(180deg, #2a2a2e, #101012);
  border-radius: 2px 0 0 2px;
  box-shadow: -1px 0 0 rgba(255, 255, 255, 0.04);
}

.device-frame::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 26%;
  width: 3px;
  height: 48px;
  background: linear-gradient(180deg, #2a2a2e, #101012);
  border-radius: 0 2px 2px 0;
}

.device-frame__screen {
  width: 100%;
  height: auto;
  border-radius: calc(var(--device-radius) - var(--device-bezel));
  overflow: hidden;
  background: #0a0a0c;
  line-height: 0;
}

.device-frame__screen img {
  display: block;
  width: 100%;
  height: auto;
}

/* QR / share card: natural ratio inside a softer “print” frame */
.device-showcase--card .device-frame {
  --card-frame-radius: 20px;
  --card-screen-radius: 16px;
  aspect-ratio: auto;
  width: min(100%, 300px);
  padding: 14px;
  border-radius: var(--card-frame-radius);
  background: linear-gradient(165deg, #2a2622 0%, #0c0b0a 100%);
  box-shadow: var(--shadow-device);
}

.device-showcase--card .device-frame::before,
.device-showcase--card .device-frame::after {
  display: none;
}

.device-showcase--card .device-frame__screen {
  border-radius: var(--card-screen-radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.device-showcase--card .device-frame__screen img {
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* Center odd fifth when 2-col layout (5 items) */
@media (min-width: 620px) and (max-width: 1023px) {
  .devices-grid .device-showcase:nth-child(5):last-child {
    grid-column: 1 / -1;
    max-width: min(400px, 100%);
  }
}

.site-footer {
  margin-top: 3.5rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.site-footer strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.site-footer code {
  font-size: 0.78em;
  padding: 0.12em 0.35em;
  border-radius: 2px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}
