/* ofuda.kiyoshi.dev: the website's one stylesheet (home page and legal pages). */

/* Headlines: Bricolage Grotesque (OFL), body: Geist (OFL, the app's own font), the one word in
   the headline: Kaushan Script (OFL). Both served from
   here, so opening the site sends nothing to Google. Bricolage is the Latin subset with the
   weight and optical size axes, from @fontsource-variable/bricolage-grotesque. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Kaushan Script";
  src: url("fonts/KaushanScript-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #07070c;
  --card: #0f0f17;
  --line: #1d1d2b;
  --text: #ececf5;
  --muted: #9a9ab0;
  --accent: #6c7cff;
  --accent-soft: #a9b4ff;
  --display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; overflow-x: clip; }
body { margin: 0; color: var(--text); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--accent-soft); text-decoration: none; }

/* Scrollbar: dark and quiet, the thumb turns accent blue under the pointer. Chromium and Safari
   take the ::-webkit-scrollbar rules (Chromium ignores them once scrollbar-color is set, hence
   the @supports), Firefox the two standard properties. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23233a; border: 2px solid var(--bg); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: #23233a var(--bg); scrollbar-width: thin; }
}
a:hover { text-decoration: underline; }
.wrap { padding: 0 clamp(24px, 5vw, 96px); }

/* ── Top bar ── */
.top { position: relative; z-index: 3; display: flex; align-items: center; gap: 28px; height: 72px; }
.top .logo img { height: 20px; display: block; }
.top nav { margin-left: auto; display: flex; gap: 24px; font-size: 14px; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); text-decoration: none; }

/* ── Hero ── */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 24px; min-height: calc(100vh - 72px); max-height: 820px; padding-bottom: 72px; }
.hero::after { /* the light under the page */
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: -260px; width: 140vw; height: 460px; transform: translateX(-50%);
  border-radius: 50%; background: #4b4fd8; filter: blur(110px); opacity: .42; pointer-events: none;
}
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 6.4vw, 84px); line-height: .98; letter-spacing: -.03em; margin: 0 0 30px; }
/* "spice.": brush script in a gradient from the accent into the cover's pink, with a stroke
   under it that draws itself, wipes away and draws again. */
.spice { position: relative; display: inline-block; font-family: "Kaushan Script", cursive; font-weight: 400; font-size: 1.3em; line-height: 1.1; letter-spacing: 0;
  padding-right: .12em; background: linear-gradient(100deg, var(--accent-soft) 10%, #f27aa0 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spice svg { position: absolute; left: -2%; bottom: -.2em; width: 100%; height: .42em; overflow: visible; }
.spice path { fill: none; stroke: #f27aa0; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 240; stroke-dashoffset: 240; animation: swoosh 4.5s ease-in-out infinite; }
@keyframes swoosh { 0% { stroke-dashoffset: 240; } 30%, 82% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -240; } }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 34ch; margin: 0 0 30px; }
.cta { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--text); color: var(--bg); font: 600 15px var(--body); }
.cta:disabled { background: #15151f; color: var(--muted); border: 1px solid var(--line); cursor: default; }
.cta:not(:disabled):hover { text-decoration: none; background: #fff; }
.cta svg { width: 18px; height: 18px; }

/* ── The widget, taken apart into its layers ── */
.stage { position: relative; height: 520px; perspective: 1100px; }
.rig { position: absolute; left: 55%; top: 52%; width: 440px; height: 132px; margin: -66px 0 0 -220px; transform-style: preserve-3d; animation: tilt 12s ease-in-out infinite; }
.layer { position: absolute; transform-style: preserve-3d; animation: 7s ease-in-out infinite; }
.l-canvas { inset: 0; border-radius: 26px; border: 1.5px dashed #34345c; animation-name: z0; }
.l-bg { inset: 0; border-radius: 26px; background: #3d2f78e8; box-shadow: 0 0 60px #6c7cff55; animation-name: z1; }
.l-cover { left: 16px; top: 16px; width: 100px; height: 100px; border-radius: 18px; background: linear-gradient(140deg, #f27aa0, #c23f6c); animation-name: z2; }
.l-text { left: 136px; top: 34px; width: 260px; height: 40px; animation-name: z4; }
.l-text i { display: block; height: 15px; width: 230px; border-radius: 4px; background: #fff; }
.l-text i + i { height: 11px; width: 130px; margin-top: 12px; background: var(--accent-soft); }
.l-viz { left: 136px; top: 88px; width: 140px; height: 22px; display: flex; gap: 6px; align-items: flex-end; animation-name: z3; }
.l-viz b { width: 7px; height: 22px; border-radius: 2px; background: #fff; transform-origin: bottom; animation: bar .9s ease-in-out infinite; }
.l-viz b:nth-child(2) { animation-delay: .15s; } .l-viz b:nth-child(3) { animation-delay: .3s; } .l-viz b:nth-child(4) { animation-delay: .45s; }
.l-viz b:nth-child(5) { animation-delay: .6s; } .l-viz b:nth-child(6) { animation-delay: .75s; } .l-viz b:nth-child(7) { animation-delay: .9s; }

@keyframes tilt { 0%, 100% { transform: rotateX(56deg) rotateZ(-34deg); } 50% { transform: rotateX(50deg) rotateZ(-24deg); } }
/* Together, apart, together: each layer rises to its own height. */
@keyframes z0 { 0%, 100% { transform: translateZ(0); } }
@keyframes z1 { 0%, 18%, 82%, 100% { transform: translateZ(1px); } 42%, 58% { transform: translateZ(55px); } }
@keyframes z2 { 0%, 18%, 82%, 100% { transform: translateZ(2px); } 42%, 58% { transform: translateZ(110px); } }
@keyframes z3 { 0%, 18%, 82%, 100% { transform: translateZ(3px); } 42%, 58% { transform: translateZ(165px); } }
@keyframes z4 { 0%, 18%, 82%, 100% { transform: translateZ(4px); } 42%, 58% { transform: translateZ(220px); } }
@keyframes bar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .rig { animation: none; transform: rotateX(54deg) rotateZ(-30deg); }
  .l-bg { transform: translateZ(55px); } .l-cover { transform: translateZ(110px); }
  .l-viz { transform: translateZ(165px); } .l-text { transform: translateZ(220px); }
}

/* ── How it works ── */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 24px 0 96px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.step .n { font-family: var(--display); font-size: 15px; color: var(--accent-soft); }
.step h2 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; margin: 10px 0 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ── Footer ── */
footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding-top: 28px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
footer .links { margin-left: auto; display: flex; gap: 20px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* ── Legal pages ── */
.legal { max-width: 720px; padding: 24px 0 72px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin: 24px 0 6px; }
.legal h2 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; margin: 40px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); font-weight: 600; }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal .updated { margin: 0 0 32px; font-size: 14px; }

/* ── Wide screens: the widget grows with the room ── */
@media (min-width: 1500px) {
  .stage { height: 640px; }
  .rig { transform: scale(1.3) rotateX(54deg) rotateZ(-30deg); }
}
@media (min-width: 1500px) and (prefers-reduced-motion: no-preference) {
  .rig { animation-name: tilt-large; }
  @keyframes tilt-large { 0%, 100% { transform: scale(1.3) rotateX(56deg) rotateZ(-34deg); } 50% { transform: scale(1.3) rotateX(50deg) rotateZ(-24deg); } }
}

/* ── Narrow screens ── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; max-height: none; padding: 40px 0 24px; text-align: left; }
  .stage { height: 380px; margin-top: -10px; }
  .rig { left: 50%; transform: scale(.72); }
  .steps { grid-template-columns: 1fr; padding-bottom: 64px; }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  .rig { animation-name: tilt-small; }
  @keyframes tilt-small { 0%, 100% { transform: scale(.72) rotateX(56deg) rotateZ(-34deg); } 50% { transform: scale(.72) rotateX(50deg) rotateZ(-24deg); } }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .top nav { gap: 16px; }
  .stage { height: 300px; }
  .rig { transform: scale(.56); }
}
@media (max-width: 520px) and (prefers-reduced-motion: no-preference) {
  .rig { animation-name: tilt-xs; }
  @keyframes tilt-xs { 0%, 100% { transform: scale(.56) rotateX(56deg) rotateZ(-34deg); } 50% { transform: scale(.56) rotateX(50deg) rotateZ(-24deg); } }
}
