* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --paper: #FAF2E3;
    --ink: #211E1C;
    --muted: #6B645C;
    --accent: #B8613D;
    --rule: #D9D4CC;
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --glass-bg: rgba(255, 252, 247, 0.52);
    --glass-strong: rgba(255, 252, 247, 0.66);
    --glass-soft: rgba(255, 252, 247, 0.36);
    --glass-strong-hover: rgba(255, 252, 247, 0.8);
    --glass-soft-hover: rgba(255, 252, 247, 0.52);
    --glass-border: rgba(33, 30, 28, 0.14);
    --glass-border-strong: rgba(33, 30, 28, 0.24);
    --glass-sheen: rgba(255, 255, 255, 0.82);
    --glass-shadow: 0 8px 32px 0 rgba(33, 30, 28, 0.08);
    --glass-shadow-hover: 0 12px 40px 0 rgba(33, 30, 28, 0.12);
    --glass-nav-scrolled: rgba(255, 252, 247, 0.78);
    --wave: var(--accent);
    --selection: rgba(184, 97, 61, 0.28);
    --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --blur-amount: 40px;
    --nav-offset: 180px;
    color-scheme: light;
    scrollbar-color: var(--rule) var(--paper);
}

:root[data-theme="dark"] {
    --paper: #1A1A1F;
    --ink: #EDE8E0;
    --muted: #99928A;
    --accent: #E0855C;
    --rule: #38383D;
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.14);
    --glass-soft: rgba(255, 255, 255, 0.06);
    --glass-strong-hover: rgba(255, 255, 255, 0.22);
    --glass-soft-hover: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(237, 232, 224, 0.18);
    --glass-border-strong: rgba(237, 232, 224, 0.32);
    --glass-sheen: rgba(255, 255, 255, 0.28);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    --glass-shadow-hover: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    --glass-nav-scrolled: rgba(26, 26, 31, 0.72);
    --selection: rgba(224, 133, 92, 0.35);
    color-scheme: dark;
}

html {
    scroll-behavior: smooth;
    background: var(--paper);
    color: var(--text-primary);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        transition: background-color 0.4s ease, color 0.4s ease;
    }
}

body {
    font-family: var(--font-ui);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

.journal-background {
    position: fixed;
    inset: 0;
    background-color: var(--paper);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 27.5px,
        var(--rule) 27.5px,
        var(--rule) 28px
    );
    z-index: -1;
}

@media (prefers-reduced-motion: no-preference) {
    .journal-background {
        transition: background-color 0.4s ease;
    }
}

.glass-card,
.glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow), inset 0 1px 0 0 var(--glass-sheen);
    position: relative;
}

.glass-card::before,
.glass-nav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-sheen) 50%, transparent);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    max-width: 1320px;
    padding: 8px 40px;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-nav.is-scrolled {
    background: var(--glass-nav-scrolled);
    border-color: var(--glass-border-strong);
    box-shadow: var(--glass-shadow-hover), inset 0 1px 0 0 var(--glass-sheen);
}

.nav-container,
.nav-actions,
.nav-links {
    display: flex;
    align-items: center;
}

.nav-container {
    justify-content: space-between;
}

.nav-actions {
    gap: 12px;
}

.nav-links {
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1;
    text-decoration: none;
}

.logo-mark {
    width: 64px;
    height: 64px;
    flex: none;
    background-color: var(--ink);
    -webkit-mask: url("logo.png") center / contain no-repeat;
    mask: url("logo.png") center / contain no-repeat;
}

.logo-text {
    display: inline-block;
    font-family: inherit;
    font-weight: 400;
    line-height: 1;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.3s ease;
}

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

.nav-links a.active {
    font-weight: 600;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--glass-border-strong);
    background: var(--glass-strong);
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(33, 30, 28, 0.08), inset 0 1px 0 0 var(--glass-sheen);
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--glass-strong-hover);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.theme-icon-moon {
    fill: currentColor;
}

.theme-icon-sun {
    display: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon-sun circle {
    fill: currentColor;
    stroke: none;
}

:root[data-theme="dark"] .theme-icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
    display: block;
}

main,
.slides-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.slide {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    position: absolute;
    inset: 0;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.cta-button,
.btn-app-store,
.btn-primary,
.btn-secondary {
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.cta-button::before,
.btn-app-store::before,
.btn-primary::before,
.btn-secondary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-sheen) 50%, transparent);
    pointer-events: none;
}

.cta-button,
.btn-app-store,
.btn-primary {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border-strong);
    box-shadow: 0 4px 16px rgba(33, 30, 28, 0.08), inset 0 1px 0 0 var(--glass-sheen);
}

.cta-button:hover,
.btn-app-store:hover,
.btn-primary:hover {
    background: var(--glass-strong-hover);
    border-color: var(--glass-border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(33, 30, 28, 0.12), inset 0 1px 0 0 var(--glass-sheen);
}

.cta-button {
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-secondary {
    padding: 16px 32px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-soft);
    box-shadow: 0 4px 16px rgba(33, 30, 28, 0.06), inset 0 1px 0 0 var(--glass-sheen);
    font-size: 1rem;
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--glass-soft-hover);
    border-color: var(--glass-border-strong);
    box-shadow: 0 6px 20px rgba(33, 30, 28, 0.1), inset 0 1px 0 0 var(--glass-sheen);
}

.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: start;
    padding: 120px 40px 80px;
    max-width: 1320px;
    margin: 0 auto;
    column-gap: 80px;
    row-gap: 32px;
}

.hero-content {
    grid-column: 1;
    grid-row: 1;
    max-width: 38rem;
    width: 100%;
}

.hero-visual {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hero-buttons {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-title,
.slide-card-title {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.hero-title {
    font-size: clamp(2.5rem, 4vw, 3.25rem);
    line-height: 1.05;
    margin-bottom: 24px;
}

.title-line {
    display: block;
}

@media (min-width: 969px) {
    .title-line {
        white-space: nowrap;
    }
}

.hero-subtitle,
.slide-card-text {
    font-family: var(--font-display);
    color: var(--text-secondary);
    font-weight: 400;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 1.6vw, 1.5rem);
    line-height: 1.45;
    max-width: 36rem;
}

.btn-app-store {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: 16px;
}

.app-store-icon {
    display: flex;
    align-items: center;
}

.app-store-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.app-store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.app-store-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

.app-store-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.hero-visual .glass-card {
    cursor: grab;
    will-change: transform;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.audio-wave {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.wave-bar {
    width: 8px;
    background: var(--wave);
    border-radius: 4px;
    animation: wave 1.5s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 40px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 80px; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 120px; animation-delay: 0.4s; }
.wave-bar:nth-child(4) { height: 80px; animation-delay: 0.6s; }
.wave-bar:nth-child(5) { height: 40px; animation-delay: 0.8s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); opacity: 0.55; }
    50% { transform: scaleY(1); opacity: 1; }
}

.about-slide {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    padding: var(--nav-offset) 40px 40px;
    overflow: hidden;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
    width: 100%;
}

.about-card {
    padding: 32px 36px;
    text-align: center;
}

.about-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: calc(50% - 10px);
    margin: 0 auto;
    width: 100%;
}

.slide-card-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.15;
    margin-bottom: 16px;
}

.slide-card-text {
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    line-height: 1.6;
}

.glass-card {
    padding: 60px 80px;
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow-hover), inset 0 1px 0 0 var(--glass-sheen);
    border-color: var(--glass-border-strong);
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 40px 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    z-index: 100;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.footer-credit a {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.nav-cta-mobile {
    display: none;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

::selection {
    background: var(--selection);
    color: var(--text-primary);
}

@media (max-width: 968px) {
    :root { --nav-offset: 116px; }

    .glass-nav {
        width: calc(100% - 40px);
        padding: 10px 24px;
        top: 12px;
    }

    .hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 40px;
        text-align: center;
        padding: 100px 24px 32px;
        justify-content: flex-start;
        height: 100vh;
        min-height: unset;
        overflow: hidden;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-visual {
        width: 100%;
        flex: none;
        margin-top: 16px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .hero-subtitle {
        margin-inline: auto;
    }

    .nav-links {
        gap: 20px;
    }

    .glass-card {
        padding: 40px 32px;
    }

    .about-grid {
        gap: 16px;
    }
}

@media (max-width: 640px) {
    :root { --nav-offset: 134px; }

    .glass-nav {
        width: calc(100% - 24px);
        padding: 8px 16px;
        top: 10px;
        border-radius: 16px;
    }

    .nav-container {
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
    }

    .logo {
        grid-column: 2;
        justify-self: center;
        font-size: 2.25rem;
    }

    .logo-mark {
        width: 48px;
        height: 48px;
    }

    .nav-actions {
        grid-column: 3;
        justify-self: end;
    }

    .nav-links {
        display: none;
    }

    .cta-button {
        padding: 8px 16px;
        font-size: 0.8125rem;
    }

    .hero {
        gap: 32px;
        padding: 96px 16px 32px;
        height: 100vh;
        min-height: unset;
        overflow: hidden;
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 2.75rem);
        margin-bottom: 16px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .btn-app-store,
    .btn-secondary {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }

    .btn-secondary {
        padding: 14px 24px;
    }

    .hero-btn-learnmore {
        order: 1;
    }

    .hero-btn-appstore {
        order: 2;
    }

    .audio-wave {
        padding: 24px;
        min-height: unset;
        height: 120px;
    }

    .hero-visual .glass-card {
        width: auto;
        flex: none;
    }

    .wave-bar:nth-child(3) { height: 72px; }
    .wave-bar:nth-child(2),
    .wave-bar:nth-child(4) { height: 48px; }
    .wave-bar:nth-child(1),
    .wave-bar:nth-child(5) { height: 28px; }

    .about-slide {
        padding: var(--nav-offset) 16px 16px;
        align-items: center;
        justify-content: flex-start;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        justify-items: center;
    }

    .about-card:nth-child(3) {
        grid-column: 1;
        max-width: 100%;
    }

    .about-card,
    .glass-card {
        padding: 24px 20px;
        width: 100%;
    }

    .glass-card {
        border-radius: 18px;
    }

    .footer {
        padding: 12px 16px;
        font-size: 0.6875rem;
    }
}

@media (max-width: 640px) and (max-height: 720px) {
    .hero {
        gap: 16px;
        padding-top: 84px;
    }

    .hero-title {
        margin-bottom: 8px;
    }

    .audio-wave {
        height: 96px;
        padding: 16px;
    }

    .about-grid {
        gap: 10px;
    }

    .about-card,
    .glass-card {
        padding: 16px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .floating,
    .wave-bar {
        animation: none;
    }

    .glass-card,
    .glass-nav,
    .cta-button,
    .btn-app-store,
    .btn-primary,
    .btn-secondary,
    .journal-background,
    html {
        transition: none;
    }
}
