/* style.css - Premium, Authentic Styling */

/* [ADR-015: Zero-IP-Leak Self-Hosted Font Subsetting (Website/_assets/fonts/)] */
@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('_assets/fonts/lora-latin.woff2') format('woff2');
    unicode-range: U+0000-024F, U+2000-206F, U+2190-21FF;
}

@font-face {
    font-family: 'Lora';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('_assets/fonts/lora-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-024F, U+2000-206F, U+2190-21FF;
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('_assets/fonts/nunito-latin.woff2') format('woff2');
    unicode-range: U+0000-024F, U+2000-206F, U+2190-21FF;
}

@font-face {
    font-family: 'Noto Sans JP';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('_assets/fonts/noto-sans-jp-subset.woff2') format('woff2');
    unicode-range: U+3000-30FF, U+4E00-9FFF, U+FF00-FFEF;
}

@font-face {
    font-family: 'Noto Serif JP';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('_assets/fonts/noto-serif-jp-subset.woff2') format('woff2');
    unicode-range: U+3000-30FF, U+4E00-9FFF, U+FF00-FFEF;
}

:root {
    /* Brand Paper Palette (ref1 inspired) */
    --paper: #FAF9F6;
    --ink: #30362c;
    --muted: #62675d;
    --line: #d6d8ce;
    --olive: #45513c;
    --accent: #a45f48;
    --section-tint: #F0EFEB; /* Macro-shift warm tinted paper tone for Section 3 */
    --header-height: 88px;
    --grid-gap: 32px; /* Standardized 12-column architectural grid gutter */

    /* Light Palette */
    --bg-color: #FAF9F6; /* Alabaster / Off-white */
    --text-main: #30362c;
    --text-muted: #62675d;
    --accent-gray: #E5E5EA;
    
    /* My Moon App Color System (Slate Mist Palette) */
    --moon-bg: #D7DBE0;
    --moon-surface: #091A2A;
    --moon-text: #0F2438;
    --moon-muted: #4B5A68;
    --moon-accent1: #1F656F;
    --moon-accent1-light: #2E93A3;
    --moon-accent2: #C9828A;
    --moon-accent2-dark: #A96470;
    --moon-cream: #F3F0D8;
    
    /* Fonts */
    --font-serif: 'Lora', Georgia, serif;
    --font-sans: 'Nunito', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Main Content Layer (Lifts like a curtain to unveil the fixed footer beneath) */
main {
    position: relative;
    z-index: 2;
}

/* Japanese Typography Overrides */
html[lang="ja"] body {
    font-family: 'Nunito', 'Noto Sans JP', sans-serif;
}
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] .brand {
    font-family: 'Lora', 'Noto Serif JP', serif;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px;
}

@media (max-width: 900px) {
    .container {
        padding: 0 32px;
    }
}

@media (max-width: 650px) {
    .container {
        padding: 0 26px;
    }
}

/* Typography */
h1, h2, h3, .logo {
    font-family: var(--font-serif);
    font-weight: 600;
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    letter-spacing: 0.12em;
    margin-bottom: 30px;
}

.elegant-h1 {
    position: relative;
    z-index: 0;
    background-color: var(--bg-color);
    margin-top: 80px; /* Space for the massive letter sticking up */
}

.giant-letter {
    position: absolute;
    top: -0.65em;
    left: -0.05em;
    font-size: 5em; /* Massive */
    line-height: 1;
    color: var(--text-main);
    z-index: 1;
    user-select: none;
}

.h1-text {
    position: relative;
    z-index: 2;
    color: #fff;
    margin-bottom: 5px;
    mix-blend-mode: difference;
    display: inline-block;
    text-indent: 1.5em; /* Perfect indentation to bite into the right stem of the H */
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

h2.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
}

/* Accessible Skip Link */
.skip {
    position: fixed;
    top: -100px;
    left: 20px;
    padding: 10px 16px;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 4px;
    z-index: 200;
    text-decoration: none;
    font-size: 13px;
    transition: top 0.2s ease;
}

.skip:focus {
    top: 16px;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Site Header Navigation - ref1 Minimal Layout + ref2 Frosted Translucent Glass */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: rgba(250, 249, 246, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(69, 81, 60, 0.12);
    transition: background 0.3s ease;
}

.site-header .nav {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: var(--grid-gap);
    min-height: var(--header-height);
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px;
}

.site-header .brand {
    grid-column: span 7;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 21px;
    line-height: 1.4;
    letter-spacing: -0.5px;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.site-header .nav-right {
    grid-column: span 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.site-header .navlinks {
    display: flex;
    gap: 18px;
    font-size: 13px;
}

.site-header .navlinks a {
    text-decoration: none;
    color: var(--ink);
    transition: color 0.2s ease, text-decoration 0.2s ease;
    text-underline-offset: 5px;
    white-space: nowrap;
}

.site-header .navlinks a:hover {
    text-decoration: underline;
}

/* Language Switcher - Segmented Pill Control (Matching Pill Button Aesthetic) */
.languages {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(48, 54, 44, 0.07);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid rgba(48, 54, 44, 0.08);
    flex-shrink: 0;
}

.languages button {
    font-family: var(--font-sans);
    font-size: 11.5px;
    background: transparent;
    border: 0;
    border-radius: 14px;
    padding: 4px 10px;
    color: var(--ink);
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.65;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.languages button:hover {
    opacity: 1;
    color: var(--ink);
}

.languages button[aria-pressed="true"] {
    background: #FAF9F6;
    color: var(--ink);
    opacity: 1;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(48, 54, 44, 0.12);
}

/* Navigation Responsive Breakpoints */
@media (max-width: 900px) {
    .site-header .nav {
        padding: 0 32px;
        gap: 32px;
        grid-template-columns: 6.5fr 5.5fr;
    }
    .site-header .navlinks {
        gap: 12px;
        font-size: 12px;
    }
    .site-header .brand {
        font-size: 18px;
    }
}

@media (max-width: 650px) {
    :root {
        --header-height: 112px;
    }
    .site-header .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 18px;
        padding: 16px 26px;
        min-height: 0;
    }
    .site-header .nav-right {
        display: contents;
    }
    .languages {
        margin-left: auto;
    }
    .site-header .navlinks {
        order: 3;
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        font-size: 12px;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(69, 81, 60, 0.08);
    }
}

/* Section 1: Main (Hero) */
.hero {
    padding: 150px 0 180px;
    min-height: 75vh;
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: var(--grid-gap);
    width: 100%;
}

.hero-content {
    grid-column: span 7;
}

.eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--olive);
    margin-bottom: 20px;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(38px, 4.6vw, 56px);
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -1.4px;
    color: var(--ink);
    margin-bottom: 24px;
    text-wrap: balance;
}

.hero-content .intro {
    font-size: 14px; /* Matches button text size for a subtle, refined editorial intro */
    line-height: 1.85;
    color: var(--muted);
    max-width: 480px;
    margin-bottom: 32px;
}

html[lang="ja"] .hero-content .intro {
    font-size: 14px;
    line-height: 2.0;
}

.actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Primary Pill Button (ref1 authentic dark ink palette) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ink);
    color: #FAF9F6;
    padding: 13px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 18px rgba(48, 54, 44, 0.16);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(48, 54, 44, 0.22);
    background-color: #242a20;
}

/* Secondary Editorial Text Link with Arrow */
.textlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ink);
    text-decoration: none;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.textlink:hover {
    text-decoration: underline;
    color: var(--accent);
}

.link-arrow {
    display: inline-block;
    flex: none;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.textlink:hover .link-arrow {
    transform: translate(2px, -2px);
}

/* Portrait with Squircle & Caption (ref2 Squircle + ref1 Scale) */
.portrait {
    grid-column: span 5;
    width: 100%;
    max-width: 250px;
    justify-self: center;
    text-align: center;
    margin: 0 auto;
}

.portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    clip-path: url(#squircle);
    -webkit-clip-path: url(#squircle);
    filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.1)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.05));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.portrait img:hover {
    transform: translateY(-4px) scale(1.01);
    filter: drop-shadow(0 26px 36px rgba(0, 0, 0, 0.14)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.07));
}

.portrait figcaption {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
}

.note-mark {
    display: block;
    font-family: var(--font-serif);
    font-size: 13.5px;
    color: var(--ink);
    margin-bottom: 2px;
}

/* Section 2: Our story - Layer 2 Warm Paper Sheet (#FAF9F6) */
.story {
    position: relative;
    z-index: 2;
    margin-top: -30px; /* Overlaps bottom of SVG by 30px, submerging the seam */
    background-color: var(--bg-color);
    padding: 30px 0 200px; /* Generous bottom padding allowing Layer 3 to glide over it */
}

.story-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    align-items: start;
}

.story-lead {
    grid-column: span 5;
}

.story-lead h2 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3.4vw, 38px);
    line-height: 1.35;
    letter-spacing: -0.8px;
    color: var(--ink);
    font-weight: 500;
}

.story-text {
    grid-column: span 7;
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.95;
    color: var(--muted);
}

.story-text .lead-p {
    font-size: 17.5px;
    line-height: 1.85;
    color: var(--ink);
    margin-bottom: 22px;
}

.story-text p + p {
    margin-top: 20px;
}

.story-text .signature {
    font-family: var(--font-serif);
    font-size: 21px;
    color: var(--ink);
    margin-top: 36px;
    font-style: italic;
    letter-spacing: 0.3px;
}

/* Japanese Typography Adjustments for Story */
html[lang="ja"] .story-text {
    line-height: 2.1;
}
html[lang="ja"] .story-text .lead-p {
    line-height: 2.0;
}
html[lang="ja"] .story-lead h2 {
    line-height: 1.7;
    letter-spacing: 0.02em;
}

.btn-download {
    display: inline-block;
    background: linear-gradient(135deg, #FF9500 0%, rgba(255, 59, 48, 0.8) 100%);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 149, 0, 0.4);
}

.btn-outline {
    display: inline-block;
    border: 1px solid var(--accent-gray);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--text-main);
    background-color: var(--text-main);
    color: #fff;
}

/* --- Physical Layering Architecture (Stacked Sheets) --- */
.sheet-layer {
    position: relative;
    width: 100%;
}

/* Layer 1: Base Ground (Hero) */
.layer-base,
.layer-hero {
    position: relative;
    z-index: 1;
    background-color: var(--bg-color);
}

/* Layer 2: Story (Overlays Hero) */
.layer-story {
    position: relative;
    z-index: 2;
    margin-top: -80px;
    will-change: transform;
}

/* Layer 3: Philosophy (Overlays Story) */
.layer-philosophy {
    position: relative;
    z-index: 3;
    margin-top: -80px;
    will-change: transform;
}

/* Layer 4: Apps / My Moon (Overlays Philosophy) */
.layer-apps {
    position: relative;
    z-index: 4;
    margin-top: -80px;
    will-change: transform;
}

/* [ADR-007: Ambient Lunar Glow Overlay]
   Applies a unified soft radial glow across Layer 4 spanning from the top of the scissor seam
   down into the showcase section. Positioned on .layer-apps with mix-blend-mode: soft-light so that
   it blends evenly over both the SVG carrier and the section body without causing a horizontal boundary line. */
.layer-apps::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 1200px);
    height: 750px;
    background: radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.45) 0%, rgba(46, 147, 163, 0.08) 50%, transparent 75%);
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: soft-light;
}

/* Layer 5: Community (Overlays Apps) */
.layer-community {
    position: relative;
    z-index: 5;
    margin-top: -80px;
    will-change: transform;
}

/* Scissor Edge Seam Carrier (Casts Elevation Bloom Shadow) */
.scissor-seam {
    width: 100%;
    height: 100px;
    line-height: 0;
    position: relative;
    z-index: 1;
    will-change: filter;
    pointer-events: none;
}

.scissor-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Parallax Inner Content Hardware Promotion */
.sheet-content,
.story-container,
.hero-container {
    will-change: transform;
}

/* Section 3: Our Philosophy - Warm Tinted Paper Sheet (#F0EFEB) */
.philosophy {
    position: relative;
    z-index: 2;
    margin-top: -30px; /* Overlaps bottom of SVG by 30px, burying the bottom seam */
    background-color: var(--section-tint);
    padding: 30px 0 200px; /* Generous bottom padding allowing Layer 3 to glide over it */
}

/* Section Header (Unified, Wide Editorial Header Spanning 8 Columns) */
.section-head {
    max-width: calc((100% - 11 * var(--grid-gap)) * 8 / 12 + 7 * var(--grid-gap));
    margin-bottom: 56px;
}

.section-head h2 {
    font-family: var(--font-serif);
    font-size: clamp(30px, 3.8vw, 42px);
    line-height: 1.3;
    letter-spacing: -0.8px;
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 18px;
}

.head-intro {
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--muted);
    max-width: 520px;
}

/* Principles 2x2 Grid (Mapped to 12-Column System: 6 cols + 6 cols) */
.principles {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-gap);
    row-gap: 48px;
    width: 100%;
}

.principle {
    grid-column: span 6;
}

.principle h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.45;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}

.principle p {
    font-size: 14.5px;
    line-height: 1.9;
    color: var(--muted);
    max-width: 420px;
}

/* Japanese Typography Adjustments for Section 3 */
html[lang="ja"] .head-lead h2 {
    line-height: 1.7;
}
html[lang="ja"] .head-intro {
    line-height: 2.0;
}
html[lang="ja"] .principle h3 {
    line-height: 1.6;
}
html[lang="ja"] .principle p {
    line-height: 2.0;
}

/* Section 4: Our Apps Showcase (My Moon) - Slate Mist Sheet (#D7DBE0) */
.showcase {
    position: relative;
    z-index: 2;
    margin-top: -30px; /* Overlaps bottom of SVG by 30px */
    background-color: var(--moon-bg);
    color: var(--moon-text);
    padding: 30px 0 200px; /* Generous bottom padding allowing Layer 5 to glide over it */
    isolation: isolate;
}

/* Section 4 Showcase Content (12-Column System: 6 cols + 6 cols) */
.showcase-content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    align-items: start;
    margin-bottom: 72px;
    width: 100%;
}

.app-lead-col {
    grid-column: span 6;
}

.app-lead-col .app-eyebrow {
    color: var(--moon-accent1);
    margin-bottom: 24px;
}

.app-heading {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.app-icon {
    width: 68px;
    height: 68px;
    border-radius: 17px;
    clip-path: url(#squircle);
    -webkit-clip-path: url(#squircle);
    box-shadow: 0 12px 28px -6px rgba(15, 36, 56, 0.28), 0 0 0 1px rgba(15, 36, 56, 0.12);
    background: var(--moon-surface);
}

.app-title-group h2 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 3.8vw, 42px);
    font-weight: 500;
    line-height: 1.15;
    color: var(--moon-text);
}

.app-byline {
    display: block;
    font-size: 13px;
    color: var(--moon-accent1);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.app-lead {
    font-family: var(--font-serif);
    font-size: 21px;
    line-height: 1.5;
    color: var(--moon-text);
    font-style: italic;
    max-width: 440px;
}

/* Right Details Column (Spans 6 columns) */
.app-details-col {
    grid-column: span 6;
}

.app-desc {
    font-size: 15px;
    line-height: 1.9;
    color: var(--moon-muted);
    margin-bottom: 24px;
}

.app-features {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
}

.app-features li {
    font-size: 14.5px;
    color: var(--moon-muted);
    padding: 7px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Celestial Dusty Rose Glowing Dot Markers (Accent 2: C9828A -> A96470) */
.app-features li::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--moon-accent2) 0%, var(--moon-accent2-dark) 100%);
    box-shadow: 0 0 10px rgba(201, 130, 138, 0.7);
    flex-shrink: 0;
}

.app-cta {
    margin-top: 8px;
}

/* App Store Pill Button with Accent 1 Teal Gradient */
.btn-appstore {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--moon-accent1-light) 0%, var(--moon-accent1) 100%);
    color: var(--moon-cream);
    padding: 13px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 24px -4px rgba(31, 101, 111, 0.35);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-appstore:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -4px rgba(31, 101, 111, 0.55);
}

.apple-icon {
    display: inline-block;
    flex-shrink: 0;
    transform: translateY(-1px);
}

.app-note {
    font-size: 12px;
    color: var(--moon-muted);
    opacity: 0.85;
    margin-top: 14px;
    line-height: 1.7;
}

/* 4-Screen Floating Device Showcase (12-Column System: 4 x 3 cols) */
.app-preview {
    width: 100%;
    margin: 0;
    position: relative;
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    width: 100%;
}

.screenshot-item {
    grid-column: span 3;
    text-align: center;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.screenshot-item:hover {
    transform: translateY(-8px);
}

.phone-device {
    display: block;
    position: relative;
    background: var(--moon-surface);
    padding: 6px;
    border: 2px solid rgba(15, 36, 56, 0.2); /* Midnight chassis rim */
    border-radius: 30px;
    box-shadow: 0 20px 36px -10px rgba(15, 36, 56, 0.32), 0 4px 14px rgba(15, 36, 56, 0.08);
    overflow: hidden;
    line-height: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-item:hover .phone-device {
    border-color: rgba(31, 101, 111, 0.45);
    box-shadow: 0 28px 46px -10px rgba(15, 36, 56, 0.45), 0 0 24px rgba(46, 147, 163, 0.22);
}

.phone-device img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 23px;
}

.screen-label {
    display: block;
    font-family: var(--font-serif);
    font-size: 13.5px;
    color: var(--moon-text);
    margin-top: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.app-preview figcaption {
    text-align: center;
    font-size: 12px;
    color: var(--moon-muted);
    opacity: 0.85;
    margin-top: 24px;
}

/* Japanese Typography Adjustments for Section 4 */
html[lang="ja"] .app-lead {
    font-style: normal;
    line-height: 1.8;
}
html[lang="ja"] .app-desc {
    line-height: 2.0;
}
html[lang="ja"] .app-features li {
    line-height: 1.8;
}

/* Section 5: Community - Warm Paper Sheet (#FAF9F6) */
.community {
    position: relative;
    z-index: 2;
    margin-top: -30px; /* Overlaps bottom of SVG by 30px */
    background-color: var(--bg-color);
    color: var(--ink);
    padding: 30px 0 160px;
    isolation: isolate;
    /* [ADR-008: Downward Sheet Shadow onto Footer Page]
       Matches preview-cutouts.html: casts a deep, soft downward shadow (0 40px 60px -20px) 
       onto the footer sheet beneath it. The negative spread (-20px) confines shadow to bottom edge. */
    box-shadow: 0 40px 60px -20px rgba(48, 54, 44, 0.28);
}

/* [ADR-009: Section 5 Unified Editorial Header Spanning 8 Columns] */
.community-head {
    max-width: calc((100% - 11 * var(--grid-gap)) * 8 / 12 + 7 * var(--grid-gap));
    margin-bottom: 56px;
}

.community-head .community-eyebrow {
    color: var(--olive);
    margin-bottom: 20px;
}

.community-head h2 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3.4vw, 38px);
    line-height: 1.35;
    letter-spacing: -0.8px;
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 18px;
}

.community-head .community-intro {
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--muted);
    max-width: 620px;
}

/* 3 Steps Grid (12-Column System: 3 x 4 cols) */
.steps {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-gap);
    row-gap: 32px;
    margin-bottom: 52px;
    width: 100%;
}

.step {
    grid-column: span 4;
    position: relative;
}

.step-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--olive);
    opacity: 0.7;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.step h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.45;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}

.step p {
    font-size: 14.5px;
    line-height: 1.85;
    color: var(--muted);
}

/* Bottom Bar (Disclaimer Note + Link Back to Apps - Full 12 Columns) */
.community-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--grid-gap);
    padding-top: 32px;
    border-top: 1px solid var(--line);
    margin-bottom: 40px;
    width: 100%;
}

.community-note {
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
    opacity: 0.85;
    max-width: 580px;
}

.community-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 3px;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.community-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.community-link:hover .link-arrow {
    transform: translateY(-2px);
}

/* Editorial Accordion FAQ (<details> / <summary> Spanning 8 Columns) */
.community-faq {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 24px;
    max-width: calc((100% - 11 * var(--grid-gap)) * 8 / 12 + 7 * var(--grid-gap));
    background-color: rgba(250, 249, 246, 0.7);
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.community-faq[open] {
    border-color: rgba(69, 81, 60, 0.3);
    background-color: var(--paper);
}

.community-faq summary {
    font-family: var(--font-serif);
    font-size: 16.5px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.community-faq summary::-webkit-details-marker {
    display: none;
}

.community-faq summary::after {
    content: "+";
    font-size: 20px;
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--olive);
    transition: transform 0.25s ease;
}

.community-faq[open] summary::after {
    content: "–";
}

.community-faq .faq-content {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.community-faq .faq-content p {
    font-size: 14.5px;
    line-height: 1.85;
    color: var(--muted);
    max-width: 680px;
}

/* Japanese Typography Adjustments for Section 5 */
html[lang="ja"] .community-head h2 {
    line-height: 1.7;
}
html[lang="ja"] .community-head .community-intro {
    line-height: 2.0;
}
html[lang="ja"] .step h3 {
    line-height: 1.6;
}
html[lang="ja"] .step p {
    line-height: 2.0;
}
html[lang="ja"] .faq-content p {
    line-height: 2.0;
}

/* --- Footer: Underlying Physical Sheet (Curtain Unveil) --- */
footer.site-footer,
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1; /* Sits underneath <main> as the stationary desk foundation */
    background-color: var(--section-tint); /* Warm tinted paper (#F0EFEB) contrasting against Section 5's #FAF9F6 */
    color: var(--ink);
    padding: 70px 0 40px; /* Generous top padding allowing the downward shadow to drape smoothly over the sheet */
    border-top: none; /* No artificial border line - separated physically by sheet elevation and shadow */
    box-sizing: border-box;
}

/* Footer Container (12-Column System: 7 cols brand + 5 cols support) */
.footer-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: flex-start;
    gap: var(--grid-gap);
    margin-bottom: 50px;
    width: 100%;
}

.footer-brand {
    grid-column: span 7;
}

.footer-brand .footer-title {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.footer-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 14.5px;
    color: var(--olive);
    margin-bottom: 8px;
}

.footer-origin {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.footer-links {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.footer-links h4 {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--olive);
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    margin-bottom: 10px;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

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

.copyright {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    padding-top: 24px;
    border-top: 1px dashed var(--line);
    width: 100%;
}

/* Japanese typography adjustments for footer */
html[lang="ja"] .footer-tagline {
    font-style: normal;
}

/* Responsive */
@media (max-width: 900px) {
    :root {
        --grid-gap: 24px;
    }
    .hero {
        padding: 130px 0 120px;
    }
    .hero-container {
        gap: 36px;
        grid-template-columns: 1fr;
    }
    .hero-content,
    .portrait {
        grid-column: span 1;
    }
    .story-container {
        gap: 36px;
        grid-template-columns: 1fr;
    }
    .story-lead,
    .story-text {
        grid-column: span 1;
    }
    .section-head {
        margin-bottom: 40px;
        max-width: none;
    }
    .head-intro {
        max-width: none;
    }
    .principles {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .principle {
        grid-column: span 1;
    }
    .showcase-content {
        grid-template-columns: 1fr;
        gap: 36px;
        margin-bottom: 50px;
    }
    .app-lead-col,
    .app-details-col {
        grid-column: span 1;
    }
    .screenshot-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        max-width: 520px;
        margin: 0 auto;
    }
    .screenshot-item {
        grid-column: span 1;
    }
    .community-head {
        margin-bottom: 40px;
        max-width: none;
    }
    .community-head .community-intro {
        max-width: none;
    }
    .steps {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 40px;
    }
    .step {
        grid-column: span 1;
    }
    .community-bottom {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    .community-faq {
        max-width: none;
    }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer-brand,
    .footer-links {
        grid-column: span 1;
    }
    .layer-story,
    .layer-philosophy,
    .layer-apps,
    .layer-community {
        margin-top: -60px;
    }
    .scissor-seam {
        height: 80px;
    }
    .story,
    .philosophy,
    .showcase,
    .community {
        padding-bottom: 140px;
    }
}

@media (max-width: 650px) {
    :root {
        --grid-gap: 16px;
    }
    .hero {
        padding: 120px 0 90px;
        min-height: auto;
    }
    .hero-container {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .portrait {
        max-width: 175px;
    }
    .actions {
        gap: 18px;
    }
    .story-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .story-lead h2 {
        max-width: none;
    }
    .layer-story,
    .layer-philosophy,
    .layer-apps,
    .layer-community {
        margin-top: -45px;
    }
    .scissor-seam {
        height: 65px;
    }
    .story,
    .philosophy,
    .showcase,
    .community {
        padding: 24px 0 110px;
        margin-top: -20px;
    }
    .principles {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .app-heading h2 {
        font-size: 32px;
    }
    .screenshot-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .phone-device {
        border-radius: 22px;
        padding: 5px;
    }
    .phone-device img {
        border-radius: 17px;
    }
    .footer-container {
        flex-direction: column;
        gap: 32px;
        margin-bottom: 30px;
    }
    .footer-links {
        align-items: flex-start;
        text-align: left;
    }
    footer.site-footer,
    footer {
        padding: 50px 0 30px;
    }
}

/* --- Elegant Animations --- */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-content {
    opacity: 0;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portrait {
    opacity: 0;
    animation: fadeInUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

/* --- Scroll Animations --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }
