/* ======================================================================
   tanso.wiki — frutiger-aero encyclopedia of carbon
   Palette: #E8F4FD, #1A2A3A, #4A90D9, #2ECC71, #FFFFFF,
            #FF6B6B, #F0C040, #7B68EE, #D0E8F8, #E0F5E0
   Fonts: Poiret One (display), Rubik (body), Fira Code (mono), Inter (fallback)
   ====================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Rubik", "Inter", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #1A2A3A;
    background: linear-gradient(160deg, #E8F4FD 0%, #D0E8F8 40%, #E0F5E0 70%, #E8F4FD 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: #7B68EE;
    color: #FFFFFF;
}

code, .formula {
    font-family: "Fira Code", "Inter", ui-monospace, monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: #4A90D9;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.1em 0.45em;
    border-radius: 6px;
    border: 1px solid rgba(74, 144, 217, 0.15);
    white-space: nowrap;
}

.formula sub {
    font-size: 0.75em;
}

a {
    color: #7B68EE;
    text-decoration: none;
}

/* ======================================================================
   Section 1: Hero
   ====================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    background: linear-gradient(120deg, #4A90D9 0%, #2ECC71 100%);
    overflow: hidden;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.45), transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 255, 255, 0.25), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 42%;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

.skyline.mini {
    position: relative;
    width: 100%;
    height: 80px;
    opacity: 0.25;
    margin-bottom: 1.5rem;
}

.hero-ripple-stage {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    z-index: 1;
    pointer-events: none;
}

.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    width: 0;
    height: 0;
    opacity: 0;
    animation: ripple 3.6s ease-out infinite;
}

.ripple.r2 { animation-delay: 0.5s; border-color: rgba(240, 192, 64, 0.7); }
.ripple.r3 { animation-delay: 1s; border-color: rgba(255, 255, 255, 0.55); }

@keyframes ripple {
    0%   { width: 0; height: 0; opacity: 0.6; }
    80%  { opacity: 0.08; }
    100% { width: 520px; height: 520px; opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 1rem;
}

.hero-title {
    font-family: "Poiret One", "Inter", serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #FFFFFF;
    line-height: 1;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    display: inline-block;
}

/* Glossy highlight clipped to text */
.hero-title::before {
    content: attr(data-glossy);
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 55%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    pointer-events: none;
}

.hero-sub {
    margin-top: 1.5rem;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: rgba(255, 255, 255, 0.92);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.hero-meta {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
}

.chip {
    font-family: "Fira Code", monospace;
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #1A2A3A;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #1A2A3A;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    z-index: 3;
    opacity: 0.75;
}

.scroll-dot {
    animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%      { transform: translateY(8px); opacity: 0.3; }
}

/* ======================================================================
   Section containers
   ====================================================================== */

.encyclopedia,
.deep-dive,
.contributors {
    position: relative;
    padding: 6rem 0 4rem;
}

.section-header {
    max-width: 1100px;
    margin: 0 auto 2.5rem;
    padding: 0 1.5rem;
    text-align: center;
}

.section-title {
    font-family: "Poiret One", "Inter", serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1A2A3A;
    margin-bottom: 0.5rem;
}

.section-lede {
    color: #1A2A3A;
    opacity: 0.7;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
}

/* ======================================================================
   Modular grid
   ====================================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }

@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .span-1, .span-2 { grid-column: span 1; }
    .span-4 { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; }
    .span-1, .span-2, .span-4 { grid-column: 1 / -1; }
}

/* ======================================================================
   Glossy module card — the frutiger-aero centrepiece
   ====================================================================== */

.module {
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
    isolation: isolate;
}

.module::before {
    /* glossy top-half sheen */
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    pointer-events: none;
    border-radius: 12px 12px 0 0;
    z-index: 0;
}

.module:hover {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.75);
}

.module > * {
    position: relative;
    z-index: 1;
}

.module-head {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    column-gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.module-head.compact {
    grid-template-rows: auto;
}

.module-head .glitch-icon {
    grid-row: span 2;
}

.module-head.compact .glitch-icon {
    grid-row: span 1;
}

.module-title {
    font-family: "Poiret One", "Inter", serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1A2A3A;
    align-self: end;
}

.module-title.small {
    font-size: 1.1rem;
    text-align: center;
    margin-top: 0.75rem;
}

.module-head .formula {
    align-self: start;
    justify-self: start;
    font-size: 0.75rem;
    color: #4A90D9;
}

.module p {
    color: #1A2A3A;
    opacity: 0.88;
}

.facts {
    list-style: none;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.facts li {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.facts li span {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4A90D9;
    font-weight: 500;
}

.facts li em {
    font-style: normal;
    font-family: "Fira Code", monospace;
    font-size: 0.85rem;
    color: #1A2A3A;
}

/* ======================================================================
   Glitch-art icons
   ====================================================================== */

.glitch-icon {
    position: relative;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    isolation: isolate;
}

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

.glitch-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 107, 107, 0.3) 3px,
        rgba(255, 107, 107, 0.3) 4px
    );
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}

.glitch-icon::before {
    /* highlight gloss */
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 1;
    border-radius: 10px 10px 0 0;
}

/* Periodic horizontal jump to simulate glitch */
.glitch-icon.glitching .icon-svg {
    animation: glitchJump 100ms steps(2, end) 1;
}

@keyframes glitchJump {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(2px, -1px); filter: hue-rotate(20deg); }
    100% { transform: translate(0, 0); }
}

/* ======================================================================
   Section 3: Deep dive feature article
   ====================================================================== */

.deep-dive {
    padding-top: 2rem;
}

.deep-dive .module.feature {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.feature-hero {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

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

.feature-hero::after {
    /* glitch scan overlay */
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 107, 107, 0.18) 3px,
        rgba(255, 107, 107, 0.18) 4px
    );
    mix-blend-mode: screen;
    pointer-events: none;
}

.feature-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: #1A2A3A;
    font-family: "Poiret One", "Inter", serif;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.feature-body {
    padding: 2rem;
}

.feature-title {
    font-family: "Poiret One", "Inter", serif;
    font-weight: 400;
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    letter-spacing: 0.05em;
    color: #1A2A3A;
    line-height: 1.15;
    margin-bottom: 0.6rem;
}

.feature-dek {
    color: #4A90D9;
    font-size: 1.05rem;
    margin-bottom: 1.6rem;
    font-style: italic;
}

.feature-columns {
    column-count: 2;
    column-gap: 2rem;
    margin-bottom: 1.5rem;
}

.feature-columns p {
    break-inside: avoid-column;
    margin-bottom: 1rem;
    color: #1A2A3A;
    opacity: 0.92;
}

@media (max-width: 768px) {
    .feature-columns { column-count: 1; }
    .feature-body { padding: 1.5rem; }
    .feature-hero { height: 180px; }
}

.feature-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px dashed rgba(74, 144, 217, 0.3);
    font-size: 0.8rem;
    color: #4A90D9;
    letter-spacing: 0.03em;
}

/* ======================================================================
   Section 4: Contributors
   ====================================================================== */

.contrib-grid {
    max-width: 1100px;
}

.contrib {
    text-align: center;
    padding-bottom: 1.75rem;
}

.avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    isolation: isolate;
}

.avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 107, 107, 0.18) 3px,
        rgba(255, 107, 107, 0.18) 4px
    );
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}

.avatar::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
    z-index: 1;
}

.avatar svg {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 0;
}

.contrib p {
    margin: 0.75rem 0;
    font-size: 0.92rem;
    color: #1A2A3A;
    opacity: 0.82;
}

.contrib .formula {
    display: inline-block;
    margin-top: 0.25rem;
    background: rgba(123, 104, 238, 0.12);
    border-color: rgba(123, 104, 238, 0.25);
    color: #7B68EE;
}

/* ======================================================================
   Closing footer
   ====================================================================== */

.closing {
    max-width: 1100px;
    margin: 4rem auto 0;
    padding: 3rem 1.5rem 3rem;
    text-align: center;
    position: relative;
}

.closing-title {
    color: #1A2A3A !important;
    text-shadow: 0 2px 4px rgba(74, 144, 217, 0.15);
}

.closing-title::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 55%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    margin-top: 0.75rem;
    color: #4A90D9;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.stamp {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #1A2A3A;
    opacity: 0.55;
    letter-spacing: 0.08em;
}

/* ======================================================================
   Ripple trigger for deep-dive
   ====================================================================== */

.deep-dive .ripple-host {
    position: absolute;
    top: 140px;
    left: 50%;
    width: 1px;
    height: 1px;
    pointer-events: none;
    z-index: 5;
}

.deep-dive .ripple-host .ripple {
    border-color: rgba(74, 144, 217, 0.7);
    animation-play-state: paused;
}

.deep-dive .ripple-host.is-active .ripple {
    animation-play-state: running;
}

/* ======================================================================
   Reveal-on-scroll
   ====================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======================================================================
   Small screens
   ====================================================================== */

@media (max-width: 640px) {
    .facts { grid-template-columns: repeat(2, 1fr); }
    .module { padding: 1.25rem; }
    .module-head {
        grid-template-columns: 64px 1fr;
    }
    .glitch-icon {
        width: 64px;
        height: 64px;
    }
    .encyclopedia,
    .deep-dive,
    .contributors {
        padding-top: 4rem;
    }
}
