/* ==========================================================================
   CSS Variables (Inherited & Adjusted for Inner Page)
   ========================================================================== */
:root {
    --primary: #6082da;
    --primary-dark: #4a69b5;
    --primary-light: #e6ebf8;
    --bg-main: #fcfcfd;
    --bg-alt: #f2f4f8;
    --text-dark: #0f172a;
    --text-muted: #475569;
    --surface: #ffffff;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 40px;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 -20px 40px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 4px 20px rgba(96, 130, 218, 0.3);
    --transition: all 0.15s ease;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img, svg {
    max-width: 100%;
    display: block;
}

/* ==========================================================================
   Typography Rules
   ========================================================================== */
.topic {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-dark);
    white-space: normal;
    margin-top: 0;
}

.topic-xl {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.topic-lg {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.topic-md {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.char {
    color: var(--text-muted);
    word-break: break-word;
    overflow-wrap: break-word;
    word-break: keep-all;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.8;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Layout & Containers
   ========================================================================== */
.shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 5vw;
}

.shell-narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 5vw;
}

.batch {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.batch > * {
    min-width: 0;
}

/* ==========================================================================
   Header (Strictly Reused)
   ========================================================================== */
.apex {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(252, 252, 253, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.apex .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.paw {
    width: 140px;
    display: flex;
    align-items: center;
}

.vowel {
    display: flex;
    gap: 2rem;
}

.tie {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.5rem 0;
    position: relative;
}

.tie:hover {
    color: var(--primary);
}

.tie.active {
    color: var(--primary);
    font-weight: 600;
}

.tie.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.tap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: var(--surface);
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    border: none;
}

.tap:hover, .tap:focus {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(96, 130, 218, 0.4);
}

.press {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: var(--bg-alt);
    color: var(--text-dark);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
}

.press:hover, .press:focus {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==========================================================================
   Main Content Layouts (Magazine Editorial Inherited)
   ========================================================================== */
.board {
    display: block;
}

/* Section 1: Hero (Intro) */
.cloud {
    padding: 10vh 0 12vh;
    background: radial-gradient(circle at 50% -20%, var(--primary-light) 0%, var(--bg-main) 70%);
    position: relative;
    overflow: hidden;
}

.skin-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4vw;
}

.skin-spell {
    flex: 1 1 400px;
    min-width: 0;
}

.skin-visual {
    flex: 1 1 450px;
    min-width: 0;
    position: relative;
}

/* Hero Keyboard Animation CSS */
.cand-board {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8);
    transform: perspective(1000px) rotateX(10deg) rotateY(-5deg);
    transition: transform 0.5s ease;
}

.cand-board:hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
}

.cand-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cand-key {
    width: 50px;
    height: 50px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 6px rgba(0,0,0,0.04), inset 0 -2px 0 rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.cand-key.stroke-space { width: 220px; }
.cand-key.stroke-enter { width: 90px; }
.cand-key.stroke-shift { width: 70px; }

/* Color Pop Animation */
@keyframes colorPop {
    0%, 100% { background: var(--surface); border-color: transparent; }
    33% { background: #fdf2f8; border-color: #fbcfe8; }
    66% { background: #eff6ff; border-color: #bfdbfe; }
}

.cand-board:hover .cand-key:nth-child(even) {
    animation: colorPop 3s infinite ease-in-out;
}

.cand-board:hover .cand-key:nth-child(odd) {
    animation: colorPop 3s infinite ease-in-out reverse;
}

/* Section 2: Gallery Detail (Aside) */
.realm-detail {
    padding: 6rem 0;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.realm-apex {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.glyph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.glyph-glyph {
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.glyph-glyph:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.view-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-alt);
    position: relative;
    overflow: hidden;
}

.view {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.glyph-glyph:hover .view {
    transform: scale(1.05);
}

.glyph-body {
    padding: 1.5rem;
    flex-grow: 1;
}

/* Abstract SVG covers for cards without real images */
.view-abstract {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}
.view-abstract.cyber {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}
.view-abstract.minimal {
    background: linear-gradient(135deg, #fcfcfd 0%, #f1f5f9 100%);
}

/* Section 3: Interactive Detail (Section) */
.realm-smart {
    padding: 8rem 0;
    background: var(--bg-alt);
}

.smart-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5vw;
}

.smart-char {
    flex: 1 1 350px;
    min-width: 0;
}

.smart-demo {
    flex: 1 1 400px;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stroke-pad {
    width: 120px;
    height: 120px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

/* Particle Ripple Effect */
.stroke-pad::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(96,130,218,0.4) 0%, rgba(96,130,218,0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out, opacity 0.4s ease-out;
    opacity: 0;
    pointer-events: none;
}

.stroke-pad:hover {
    transform: translateY(-5px) scale(0.98);
}

.stroke-pad:hover::before {
    width: 200px;
    height: 200px;
    opacity: 1;
}

.stroke-vocab {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}

.stroke-term {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mark-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    color: var(--primary);
}

/* Section 4: Tutorial Steps (Article) */
.phrase-steps {
    padding: 8rem 0;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -20px 40px rgba(0,0,0,0.02);
}

.flow-board {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    margin-top: 4rem;
}

.flow-track {
    flex: 1 1 300px;
    min-width: 0;
    padding: 2.5rem;
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
}

.flow-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2.5rem;
    width: 40px;
    height: 4px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

.term-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.tail {
    background: var(--bg-main);
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.space-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.trail-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.trail-links {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.trail-links a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
    .cloud { padding: 8vh 0 10vh; }
    .realm-detail, .realm-smart, .phrase-steps { padding: 5rem 0; }
    .skin-layout { flex-direction: column; text-align: center; }
    .smart-flow { flex-direction: column-reverse; text-align: center; }
    .stroke-term { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 768px) {
    .vowel { display: none; /* In a real scenario, JS toggle menu goes here */ }
    .cloud { padding: 6vh 0 8vh; }
    .topic-xl { font-size: 2.25rem; }
    .topic-lg { font-size: 1.75rem; }
    .flow-board { gap: 2rem; flex-direction: column; }
    .space-grid { flex-direction: column; text-align: center; }
}

.spell-apex {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}
.spell-apex,
.spell-apex *,
.spell-apex *::before,
.spell-apex *::after {
    box-sizing: border-box;
}

.spell-apex nav,
.spell-apex div,
.spell-apex section,
.spell-apex article,
.spell-apex aside,
.spell-apex p,
.spell-apex h1,
.spell-apex h2,
.spell-apex h3,
.spell-apex h4,
.spell-apex h5,
.spell-apex h6,
.spell-apex a {
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.spell-apex p,
.spell-apex h1,
.spell-apex h2,
.spell-apex h3,
.spell-apex h4,
.spell-apex h5,
.spell-apex h6 {
    text-decoration: none;
}

.spell-apex img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 0;
}

.spell-apex {
    box-shadow: none;
    filter: none;
    text-shadow: none;
    background-image: none;
    border-top: none;
    border-left: none;
    border-right: none;
    outline: none;
}

.spell-apex a.spell-tie {
    --aisite-shell-nav-padding: 0;
    --aisite-shell-nav-margin: 0;
    --aisite-shell-nav-line-height: normal;
    --aisite-shell-nav-display: inline;
    --aisite-shell-nav-height: auto;
    --aisite-shell-nav-min-height: auto;
}

.spell-apex a.spell-tie,
.spell-apex a.spell-tie:hover,
.spell-apex a.spell-tie:focus,
.spell-apex a.spell-tie:active,
.spell-apex a.spell-tie.active,
.spell-apex a.spell-tie[aria-current="page"] {
    background: transparent;
    border: none;
    border-bottom: none;
    box-shadow: none;
    outline: none;
    text-decoration: none;
    padding: var(--aisite-shell-nav-padding, 0);
    margin: var(--aisite-shell-nav-margin, 0);
    line-height: var(--aisite-shell-nav-line-height, normal);
    display: var(--aisite-shell-nav-display, inline);
    height: var(--aisite-shell-nav-height, auto);
    min-height: var(--aisite-shell-nav-min-height, auto);
}

.spell-apex .spell-shell{
            max-width: 1240px;
            margin: 0 auto;
            padding: 0 5vw;
        }

.spell-apex{
            position: sticky;
            top: 0;
            z-index: 100;
            background: rgba(252, 252, 253, 0.85);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(0,0,0,0.05);
            padding: 1rem 0;
        }

.spell-apex .spell-shell{
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            min-width: 0;
        }

.spell-apex .spell-paw{
            display: flex;
            align-items: center;
            min-width: 0;
            height: 36px;
        }

.spell-apex .spell-paw img{
            height: 100%;
            width: auto;
            display: block;
        }

.spell-apex .spell-vowel{
            display: flex;
            flex-wrap: wrap;
            gap: 2rem;
            align-items: center;
            min-width: 0;
        }

.spell-apex .spell-tie{
            text-decoration: none;
            color: #475569;
            font-weight: 500;
            font-size: 1rem;
            transition: all 0.15s ease;
            position: relative;
        }

.spell-apex .spell-tie:hover, .spell-apex .spell-tie.active{
            color: #6082da;
        }

.spell-apex .spell-tie.active::after{
            content: '';
            position: absolute;
            bottom: -6px;
            left: 0;
            width: 100%;
            height: 2px;
            background: #6082da;
            border-radius: 2px;
        }

@media (max-width: 768px){.spell-apex .spell-vowel{ display: none;  }}

.spell-apex {
    background: rgb(252, 252, 253);
    background-image: none;
}

.space-tail {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}
.space-tail,
.space-tail *,
.space-tail *::before,
.space-tail *::after {
    box-sizing: border-box;
}

.space-tail nav,
.space-tail div,
.space-tail section,
.space-tail article,
.space-tail aside,
.space-tail p,
.space-tail h1,
.space-tail h2,
.space-tail h3,
.space-tail h4,
.space-tail h5,
.space-tail h6,
.space-tail a {
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.space-tail p,
.space-tail h1,
.space-tail h2,
.space-tail h3,
.space-tail h4,
.space-tail h5,
.space-tail h6 {
    text-decoration: none;
}

.space-tail img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 0;
}

.space-tail {
    box-shadow: none;
    filter: none;
    text-shadow: none;
    background-image: none;
    border-top: none;
    border-left: none;
    border-right: none;
    outline: none;
}

.space-tail a,
.space-tail a:hover,
.space-tail a:focus,
.space-tail a:active {
    background: transparent;
    box-shadow: none;
    outline: none;
    text-decoration: none;
}

.space-tail .space-shell{
            max-width: 1240px;
            margin: 0 auto;
            padding: 0 5vw;
        }

.space-tail .space-topic{
            word-break: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: #0f172a;
        }

.space-tail{
            background: #0f172a;
            color: #94a3b8;
            padding: 6rem 0 3rem;
            display: flex;
            flex-wrap: wrap;
            min-width: 0;
        }

.space-tail .space-tail-shell{
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 4rem;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding-bottom: 4rem;
            margin-bottom: 2rem;
            min-width: 0;
        }

.space-tail .space-tail-space{
            flex: 1;
            min-width: 280px;
            display: flex;
            flex-wrap: wrap;
            flex-direction: column;
        }

.space-tail .space-tail-topic{
            color: #fff;
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            letter-spacing: -0.02em;
        }

.space-tail .space-tail-flow{
            display: flex;
            flex-wrap: wrap;
            gap: 3rem;
            min-width: 0;
        }

.space-tail .space-tail-batch{
            display: flex;
            flex-wrap: wrap;
            flex-direction: column;
            gap: 1rem;
            min-width: 120px;
        }

.space-tail .space-tail-batch .space-topic{
            color: #fff;
            font-size: 1rem;
            margin-bottom: 0.5rem;
        }

.space-tail .space-tail-tie{
            color: #94a3b8;
            text-decoration: none;
            transition: all 0.15s ease;
        }

.space-tail .space-tail-tie:hover{
            color: #e6ebf8;
        }

.space-tail .space-trail{
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            font-size: 0.875rem;
            min-width: 0;
        }

@media (max-width: 768px){.space-tail .space-tail-shell{ flex-direction: column; }}