/* The landing page. */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
}

body {
    overflow-x: hidden;
}

/* ---------- Navigation ---------- */

.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    border-bottom: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s, backdrop-filter 0.2s;
}

.site-nav.scrolled {
    border-bottom-color: var(--border);
    background: rgba(15, 16, 20, 0.84);
    backdrop-filter: blur(14px);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 68px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    padding: 6px 12px;
    border-radius: var(--radius-small);
    color: var(--muted);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
}

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

.nav-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

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

.hero {
    position: relative;
    overflow: hidden;
    padding: 132px 0 96px;
    background:
        radial-gradient(ellipse 50% 60% at 74% 44%, rgba(255, 77, 90, 0.16), transparent 70%),
        radial-gradient(ellipse 60% 50% at 10% 110%, rgba(47, 125, 246, 0.08), transparent 70%);
}

.hero-lines {
    --fx: 74%;
    --fy: 46%;
    position: absolute;
    inset: 0;
    opacity: 0.9;
    pointer-events: none;
}

.hero-tone {
    position: absolute;
    left: -80px;
    bottom: -60px;
    width: 520px;
    height: 360px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 70%, #000 0%, transparent 65%);
    mask-image: radial-gradient(ellipse at 30% 70%, #000 0%, transparent 65%);
    opacity: 0.5;
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: 64px;
}

.hero-copy h1 {
    margin: 18px 0 22px;
    font-size: clamp(2.8rem, 5.4vw, 5rem);
    line-height: 1.04;
}

/* The word in red, underlined with a stroke of ink. */
.ink-word {
    position: relative;
    display: inline-block;
    color: var(--accent);
}

.ink-word::after {
    content: "";
    position: absolute;
    left: -2%;
    right: -4%;
    bottom: -0.06em;
    height: 0.2em;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M2 14 C 40 4, 90 6, 130 9 S 185 12, 198 5' fill='none' stroke='%23ff4d5a' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
    opacity: 0.85;
}

.lead {
    max-width: 560px;
    margin: 0;
    color: #b9bac7;
    font-size: 18.5px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin: 30px 0 0;
    padding: 0;
    color: var(--muted);
    font-size: 14px;
    list-style: none;
}

.hero-points li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-points li::before {
    content: "";
    width: 14px;
    height: 8px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: translateY(-2px) rotate(-45deg);
}

/* ---------- The demo ---------- */

.hero-demo {
    position: relative;
    justify-self: center;
    width: min(100%, 460px);
    padding-left: 40px;
}

.demo-page {
    position: relative;
    padding: 10px;
    border-radius: 6px;
    background: var(--paper);
    box-shadow:
        0 50px 90px -30px rgba(0, 0, 0, 0.9),
        0 18px 30px -18px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: rotate(1.6deg);
}

.demo-page canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1500 / 2121;
    background: #fff;
}

.demo-script {
    position: absolute;
    left: -64px;
    top: 42%;
    z-index: 2;
    width: 250px;
    margin: 0;
    padding: 12px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(24, 25, 32, 0.9);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    transform: rotate(-3deg);
    font-size: 13px;
}

.demo-script figcaption {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--faint);
    font: 600 11.5px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.demo-script .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.demo-script ol {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.demo-script li {
    padding: 3px 7px;
    border-radius: 6px;
    line-height: 1.4;
    transition: background 0.25s, color 0.25s;
}

.demo-script li.active {
    background: rgba(255, 77, 90, 0.18);
    color: #fff;
}

.demo-script .script-note {
    color: var(--muted);
    font-style: italic;
}

.demo-script b[data-speaker="rin"] {
    color: #ff8f98;
}

.demo-script b[data-speaker="kaito"] {
    color: #8fb8ff;
}

.demo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 30px;
    margin-top: 22px;
    padding-left: 4px;
}

.demo-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13.5px;
}

.demo-status::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warn);
    animation: pulse 1.1s ease-in-out infinite;
}

.demo-status.done::before {
    background: var(--ok);
    animation: none;
}

.demo-replay {
    padding: 4px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
}

.demo-replay:hover {
    border-color: var(--accent);
    color: var(--text);
}

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

.band {
    position: relative;
    padding: 112px 0;
}

.band + .band {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.section-intro {
    max-width: 720px;
    margin: 0 auto 56px;
    text-align: center;
}

.section-intro h2 {
    margin: 14px 0 0;
    font-size: clamp(2rem, 3.6vw, 3rem);
}

.section-lead {
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 17px;
}

/* ---------- How it works ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step {
    position: relative;
    padding: 22px 22px 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--desk) 100%);
}

.step h3 {
    margin: 6px 0 8px;
    font-size: 19px;
}

.step p {
    margin: 0;
    color: var(--muted);
}

.step-number {
    color: transparent;
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1;
    -webkit-text-stroke: 1.5px rgba(255, 77, 90, 0.8);
}

.step-art {
    display: grid;
    height: 170px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg);
}

.step-paste {
    align-content: center;
    gap: 7px;
    padding: 18px;
    font: 12.5px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
    color: #c9cad4;
}

.step-paste span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-paste span::after {
    content: "";
}

.step-paste span:last-child::after {
    content: "▍";
    color: var(--accent);
    animation: pulse 1s steps(1) infinite;
}

.step-paste b {
    color: #ff8f98;
}

.step-paste span:nth-child(2) b {
    color: #8fb8ff;
}

.step-board {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 0.9fr 1fr 1.2fr;
    gap: 7px;
    padding: 16px 36px;
    background: var(--paper);
}

.step-board i {
    position: relative;
    border: 2.5px solid #16161a;
    background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 8px);
}

.step-board i.wide {
    grid-column: span 2;
}

.step-board i.big {
    border-color: var(--accent);
    background: repeating-linear-gradient(45deg, rgba(255, 77, 90, 0.16) 0 2px, transparent 2px 8px);
}

.step-board i::after {
    content: attr(data-n);
    position: absolute;
    top: 3px;
    right: 6px;
    color: #16161a;
    font: 700 11px/1 var(--font-ui);
    font-style: normal;
}

.step-draw {
    place-items: center;
    background: var(--paper);
}

.mini-panel {
    position: relative;
    width: 76%;
    height: 72%;
    border: 3px solid #16161a;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.55) 1.3px, transparent 1.8px);
    background-size: 7px 7px;
}

.mini-balloon {
    position: absolute;
    top: 14%;
    right: 10%;
    padding: 7px 12px;
    border: 2px solid #16161a;
    border-radius: 50%;
    background: #fff;
    color: #16161a;
    font: 700 11px/1 "Comic Neue", "Comic Sans MS", sans-serif;
    text-transform: uppercase;
}

.mini-balloon::after {
    content: "";
    position: absolute;
    left: 30%;
    bottom: -9px;
    border: 5px solid transparent;
    border-top: 8px solid #16161a;
}

.mini-progress {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 10%;
    height: 6px;
    background: rgba(0, 0, 0, 0.35);
}

.mini-progress i {
    display: block;
    height: 100%;
    background: var(--select);
    animation: fill 2.6s ease-in-out infinite;
}

@keyframes fill {
    0% { width: 0; }
    70%, 100% { width: 100%; }
}

/* ---------- Features ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature {
    padding: 26px 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--desk);
    transition: border-color 0.2s, transform 0.2s;
}

.feature:hover {
    border-color: rgba(255, 77, 90, 0.45);
    transform: translateY(-3px);
}

.feature svg {
    width: 40px;
    height: 40px;
    padding: 9px;
    border-radius: 11px;
    background: rgba(255, 77, 90, 0.12);
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature h3 {
    margin: 18px 0 8px;
    font-size: 17.5px;
}

.feature p {
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
}

/* ---------- Showcase ---------- */

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 260px));
    justify-content: center;
    gap: 32px;
}

.showcase-item {
    margin: 0;
}

.showcase-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: var(--paper);
    box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.9);
    cursor: zoom-in;
    transition: transform 0.2s;
}

.showcase-item:nth-child(odd) .showcase-open {
    transform: rotate(-1.2deg);
}

.showcase-item:nth-child(even) .showcase-open {
    transform: rotate(1.2deg);
}

.showcase-open:hover {
    transform: rotate(0) translateY(-6px);
}

.showcase-open img {
    width: 100%;
    aspect-ratio: 1500 / 2121;
    object-fit: cover;
    border-radius: 5px;
}

.showcase-item figcaption {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.lightbox {
    width: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.lightbox img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    border-radius: 4px;
    background: #fff;
}

.lightbox::backdrop {
    background: rgba(5, 5, 8, 0.88);
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
}

/* ---------- Models ---------- */

.model-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.model {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--desk);
}

.model h3 {
    margin: 14px 0 6px;
    font-size: 18px;
}

.model p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.model-tag {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}

.model-tag.local {
    border-color: rgba(62, 207, 142, 0.45);
    color: #7fe3b5;
}

/* ---------- Call to action ---------- */

.cta {
    position: relative;
    overflow: hidden;
    padding: 130px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: radial-gradient(ellipse 50% 70% at 50% 50%, rgba(255, 77, 90, 0.2), transparent 70%);
    text-align: center;
}

.cta-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cta-inner {
    position: relative;
}

.cta h2 {
    max-width: 820px;
    margin: 0 auto;
    font-size: clamp(2.2rem, 4.6vw, 3.8rem);
}

.cta p {
    margin: 18px 0 34px;
    color: var(--muted);
    font-size: 18px;
}

/* ---------- Footer ---------- */

.site-footer {
    padding: 34px 0 40px;
    border-top: 1px solid var(--border);
    color: var(--faint);
    font-size: 13.5px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
}

.footer-inner p {
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 18px;
    margin-left: auto;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

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

/* ---------- Arriving on scroll ---------- */

.js .rise {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.js .rise.in {
    opacity: 1;
    transform: none;
}

.steps .rise:nth-child(2),
.feature-grid .rise:nth-child(3n + 2),
.model-grid .rise:nth-child(2) {
    transition-delay: 0.08s;
}

.steps .rise:nth-child(3),
.feature-grid .rise:nth-child(3n),
.model-grid .rise:nth-child(3) {
    transition-delay: 0.16s;
}

.model-grid .rise:nth-child(4) {
    transition-delay: 0.24s;
}

/* The demo fades in once its fonts are ready, instead of flashing fallback lettering. */
.js .hero-demo {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.js .hero-demo.ready {
    opacity: 1;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1080px) {
    .model-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .hero {
        padding-top: 112px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 56px;
    }

    .hero-demo {
        width: min(100%, 420px);
        padding-left: 0;
    }

    .demo-script {
        left: -24px;
        top: auto;
        bottom: 90px;
        width: 230px;
    }

    .steps {
        grid-template-columns: minmax(0, 1fr);
        max-width: 560px;
        margin: 0 auto;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 640px) {
    .nav-actions .btn.ghost {
        display: none;
    }

    .band {
        padding: 80px 0;
    }

    .feature-grid,
    .model-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-script {
        position: relative;
        left: 0;
        bottom: auto;
        width: auto;
        margin-bottom: 18px;
        transform: none;
    }

    .footer-links {
        margin-left: 0;
    }
}
