/* ============================================
   LINDA — Minimal Japanese Design
   ============================================ */

:root {
    --bg: #fafafa;
    --bg-sec: #f7f7f7;
    --text: #0a0a0a;
    --text-sec: #2b2b2b;
    --text-tert: #414141;
    --accent: #edf0ed;
    --border: #e0e0e0;
    --grid: rgba(0, 0, 0, 0.04);
    --wrapper: #000000;
    --inside-wrapper: #ffffff;

    --font-heading: 'Inter', sans-serif;
    --font-mono: 'Geist Mono', monospace;

    --container: 1000px;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 3rem;
    --space-xl: 5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: none;
}

html {
    font-size: 15px;
    scroll-behavior: auto;
}

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

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

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text);
}

/* ============================================
   LOADING
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.logo-svg {
    width: 40px;
    height: 40px;
    color: var(--text);
    opacity: 0;
}

.logo-svg path {
    fill: black;
}

.logo-svg rect {
    fill: white;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 650;
    opacity: 0;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 250, 250, 0.9);
    backdrop-filter: blur(8px);
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.header.scrolled {
    border-color: var(--border);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
}

.logo-mark {
    width: 24px;
    height: 24px;
    transform: rotate(6.5deg);
}

.logo-word {
    font-family: var(--font-mono);
    letter-spacing: -0.2px;
    font-size: 1.15rem;
    font-weight: 650;

    line-height: 0;
}

.nav {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 14.5px;
    color: var(--text-sec);
    text-decoration: none;
    transition: color 0.2s;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2.5px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:first-child {
    transform: translateY(3.5px) rotate(45deg);
}

.hamburger.active span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
}

/* ============================================
   MAIN & SECTIONS
   ============================================ */
.main {
    position: relative;
}

section {
    position: relative;
    padding: var(--space-xl) var(--space-md);
}

.section-inner {
    max-width: var(--container);
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: calc(var(--space-md) + 0.5rem);
}

.section-num {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-tert);
}

.section-label {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    gap: var(--space-lg);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    padding: 0;

    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-wrapper {
    width: calc(var(--container) - 150px);
}

.hero-svg {
    display: flex;
    justify-content: center;
    margin-bottom: calc(var(--space-lg) + 1rem);
}

.hero-wrapper svg {
    width: 100%;
    height: auto;
    margin: auto;
}

.hero-content {
    max-width: max-content;
    margin: auto;
}

.hero-desc {
    font-family: var(--font-mono);
    font-size: 18.5px;
    color: var(--text-sec);
    margin-bottom: var(--space-lg);
    line-height: 1.8;
}

.hero-desc mark {
    background-color: #bfd6eb;
    padding: 0.3rem 0.9rem;
}

.hero-desc b {
    color: #000000;
    text-transform: uppercase;
    font-weight: 500;
}

.ts-logo {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    transform: translateY(2px);
    color: #000000;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.btn {
    font-family: var(--font-mono);
    font-size: 14.5px;
    padding: 1.25rem 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--bg);

    line-height: 0;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--text-sec);
}

.view-on-github {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: cubic-bezier(0.075, 0.82, 0.165, 1) 400ms;

    background-color: black;
    color: white;
}

.view-on-github:hover {
    background-color: #424242 !important;
    transition: cubic-bezier(0.075, 0.82, 0.165, 1) 400ms;
}

.view-on-github svg {
    width: 20px;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text);
}

.btn-demo {
    background: var(--accent);
    color: var(--text);
}

.btn-demo:hover {
    background: var(--text);
    color: var(--bg);
}

/* Slider */
.slider-track {
    width: 44px;
    height: 140px;
    background: var(--bg-sec);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.slider-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--accent);
    transition: height 0.05s linear;
}

.slider-thumb {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: bottom 0.05s linear, background 0.2s;
}

.slider-thumb:active {
    cursor: grabbing;
}

.slider-thumb svg {
    color: var(--bg);
}

.slider-thumb.success {
    background: #22c55e;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    border-top: 1px solid var(--border);
}

.about-label {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    color: var(--inside-wrapper);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background-color: var(--wrapper);

    max-width: max-content;
    padding: 0.7rem 0.85rem;
    line-height: 1.4;
}

.about-title {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: calc(var(--space-md) + 0.5rem);
    user-select: none;
}

.about-title i {
    font-size: clamp(3.5rem, 7vw, 4.5rem);
    background-color: var(--wrapper);
    color: var(--inside-wrapper);
    display: inline-block;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.about-col h2 {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--text-sec);
}

.about-col-solution h2 {
    color: var(--text);
}

.about-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.about-list li {
    font-family: var(--font-mono);
    font-size: 14.5px;
    color: var(--text-sec);
    padding-left: 1rem;
    position: relative;
}

.about-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--text-tert);
}

.about-list-check li::before {
    content: '✓';
    color: var(--text);
}

/* ============================================
   API
   ============================================ */

.api-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.code-block {
    background: var(--bg-sec);
    border: 1px solid var(--border);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.875rem;
    border-bottom: 1px solid var(--border);
}

.code-header span {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-tert);
}

.code-copy {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-sec);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.code-copy:hover {
    color: var(--text);
}

.code-copy.copied {
    color: var(--text);
}

pre {
    padding: 1rem 0.875rem;
    margin: 0;
    overflow-x: auto;
}

code {
    font-family: var(--font-mono);
    font-size: 14.5px;
    line-height: 1.7;
}

.token-kw {
    color: #d73a49;
}

.token-str {
    color: #032f62;
}

.token-fn {
    color: #6f42c1;
}

/* Options Table */
.options-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 14.5px;
}

.options-table th,
.options-table td {
    text-align: left;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

.options-table th {
    color: var(--text-tert);
    font-weight: 400;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.options-table td {
    color: var(--text-sec);
}

.options-table td:first-child {
    color: var(--text);
}

/* ============================================
   FEATURES
   ============================================ */

.features-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.feature-item {
    padding: var(--space-md);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.feature-item:hover {
    /* border-color: var(--text); */
    background-color: var(--bg-sec);
}

.feature-num {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-tert);
    display: block;
    margin-bottom: var(--space-xs);
}

.feature-item h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spac44g: -0.02em;
    margin-bottom: 0.25rem;
}

.feature-item p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-sec);
    font-weight: 550;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: var(--space-md) var(--space-sm);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-copy {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-tert);
}

.footer-right {
    display: flex;
    gap: var(--space-sm);
}

.footer-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-sec);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        justify-content: center;
        gap: var(--space-xl);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .header-inner {
        max-width: 100%;
        padding: 0rem 1.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 3.5rem;
        --space-lg: 2rem;
    }

    .hero-wrapper .lindaicons {
        position: absolute;
        bottom: -56px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 100%;
    }

    .hero-desc {
        font-size: clamp(0.2rem, 3.5vw, 4rem);
        margin-bottom: calc(var(--space-xl));
    }

    .hero {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        height: 100vh;
    }

    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-md);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .nav.active {
        opacity: 1;
        visibility: visible;
        height: 100vh;
    }

    .nav-link {
        font-size: 1rem;
    }

    .hamburger {
        display: flex;
        z-index: 101;
    }

    .about {
        border-top: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        max-width: 80%;
        margin: auto;
    }

    .btn {
        width: 100%;
        text-align: center;
        background-color: var(--bg);
    }

    .view-on-github {
        width: 100%;
        margin: auto;
        display: initial;
        text-align: center;
    }

    .footer-copy {
        display: none;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {

    /* --- Variables --- */
    :root {
        --bg: #0f0f0f;
        --bg-sec: #1a1a1a;
        --text: #ebebeb;
        --text-sec: #a8a8a8;
        --text-tert: #919191;
        --accent: #1e2120;
        --border: #2a2a2a;
        --grid: rgba(255, 255, 255, 0.035);
        --wrapper: #ebebeb;
        --inside-wrapper: #0f0f0f;
    }

    .logo-mark rect {
        fill: #fcd3d1;
    }

    .logo-mark path {
        fill: black;
    }

    mark {
        background-color: #c8dce8;
    }

    /* --- Header backdrop --- */
    .header {
        background: rgba(15, 15, 15, 0.95);
    }

    /* --- Hero mark & bold --- */
    .hero-desc mark {
        background-color: #1e2d3d;
        color: #c8dce8;
    }

    .hero-desc b {
        color: var(--text);
    }

    .ts-logo {
        color: var(--text);
    }

    /* --- Syntax tokens --- */
    .token-kw {
        color: #f28b82;
    }

    .token-str {
        color: #7ec8e3;
    }

    .token-fn {
        color: #c9a0ff;
    }

    /* --- GitHub btn hover --- */
    .view-on-github {
        background-color: #fff;
        color: black;
    }

    .view-on-github svg {
        filter: invert(100%);
    }

    .view-on-github:hover {
        background-color: #c4c4c4 !important;
    }

    /* --- Footer border --- */
    .footer {
        border-top-color: rgba(255, 255, 255, 0.07);
    }

    /* --- Scrollbar --- */
    ::-webkit-scrollbar-thumb {
        background: #3a3a3a;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #4f4f4f;
    }
}