/* tanso.club — corporate meditation chamber
   Palette: charcoal carbon, candle gold, ember orange
   Type: IBM Plex Mono + Cormorant Garamond
*/

:root {
    --bg-deep:   #1A1612;
    --bg-mid:    #2A2219;
    --surface:   #352B20;
    --text-pri:  #E8C47C;
    --text-sec:  #B8A68E;
    --accent-1:  #D4956A;
    --accent-2:  #8B6B5E;
    --halo:      #F5D89A;

    --ease-quint: cubic-bezier(0.23, 1, 0.32, 1);
    --grid-gap: 24px;

    --font-mono: "IBM Plex Mono", "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --font-serif: "Cormorant Garamond", "Lora", Georgia, serif;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--bg-deep);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-deep);
    color: var(--text-sec);
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.9;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    cursor: default;
}

/* ----- Background canvases & ambience ----- */

#lattice-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s var(--ease-quint);
}

#lattice-canvas.lit {
    opacity: 1;
}

.candle-bloom {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 40%, rgba(245, 216, 154, 0.06) 0%, transparent 70%);
    mix-blend-mode: screen;
}

.candle-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.candle-point {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 380px;
    height: 380px;
    margin-left: -190px;
    margin-top: -190px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(245, 216, 154, 0.10) 0%, rgba(212, 149, 106, 0.04) 35%, transparent 70%);
    mix-blend-mode: screen;
    animation: candle-breathe var(--duration, 6s) var(--ease-quint) infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0.05;
    filter: blur(8px);
}

@keyframes candle-breathe {
    0%, 100% { opacity: 0.03; transform: scale(0.92); }
    50%      { opacity: 0.07; transform: scale(1.05); }
}

/* ----- Whisper navigation ----- */

.whisper-nav {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.whisper-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-pri);
    text-decoration: none;
    opacity: 0.10;
    transform: translateX(0);
    transition: opacity 0.6s var(--ease-quint), transform 0.6s var(--ease-quint), color 0.6s var(--ease-quint);
}

.whisper-link.warm,
.whisper-link:hover {
    opacity: 0.65;
    transform: translateX(-8px);
    color: var(--halo);
}

.whisper-link.active {
    opacity: 0.85;
    color: var(--accent-1);
}

/* ----- Layout grid ----- */

main {
    position: relative;
    z-index: 2;
}

.section {
    position: relative;
    min-height: 100vh;
    padding: 200px 0 200px;
    display: flex;
    align-items: center;
}

.hero {
    min-height: 100vh;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

.section-grid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--grid-gap);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
}

.origin-grid     .section-header,
.origin-grid     .section-body   { grid-column: 2 / span 5; }
.structure-grid  .section-header,
.structure-grid  .section-body   { grid-column: 5 / span 5; }
.resonance-grid  .section-header,
.resonance-grid  .section-body   { grid-column: 3 / span 5; }
.signal-grid     .section-header,
.signal-grid     .section-body   { grid-column: 4 / span 5; text-align: center; }

@media (max-width: 900px) {
    .origin-grid     .section-header,
    .origin-grid     .section-body,
    .structure-grid  .section-header,
    .structure-grid  .section-body,
    .resonance-grid  .section-header,
    .resonance-grid  .section-body,
    .signal-grid     .section-header,
    .signal-grid     .section-body {
        grid-column: 1 / -1;
    }
    .whisper-nav {
        right: 10px;
        gap: 12px;
    }
    .whisper-link {
        writing-mode: vertical-rl;
        font-size: 0.6rem;
    }
}

/* ----- Hero ----- */

.hero-inner {
    text-align: center;
    z-index: 5;
    padding: 0 24px;
}

.hero-title {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-pri);
    margin: 0 0 28px;
    line-height: 1.15;
    text-shadow: 0 0 32px rgba(232, 196, 124, 0.18);
}

.hero-title .caret {
    display: inline-block;
    color: var(--accent-1);
    margin-left: 0.05em;
    animation: caret-blink 1.05s steps(2) infinite;
}

@keyframes caret-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: var(--accent-1);
    margin: 0 0 36px;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.6s var(--ease-quint);
}

.hero-subtitle.lit { opacity: 0.7; }

.hero-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    color: var(--text-sec);
    opacity: 0;
    margin: 28px 0 0;
    transition: opacity 0.8s var(--ease-quint);
}

.hero-meta.lit { opacity: 0.55; }

.scroll-hint {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.4em;
    color: var(--text-sec);
    opacity: 0;
    transition: opacity 1s var(--ease-quint) 2.5s;
}

.scroll-hint.lit { opacity: 0.5; }

.scroll-hint .scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--accent-1), transparent);
    animation: scroll-pulse 2.4s var(--ease-quint) infinite;
}

@keyframes scroll-pulse {
    0%   { transform: scaleY(0.2); transform-origin: top; opacity: 0.3; }
    50%  { transform: scaleY(1);   transform-origin: top; opacity: 0.9; }
    51%  { transform: scaleY(1);   transform-origin: bottom; }
    100% { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.3; }
}

/* ----- Section headers ----- */

.section-header {
    margin-bottom: 64px;
    position: relative;
}

.section-tag {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent-1);
    opacity: 0.8;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-pri);
    line-height: 1.15;
    margin: 0;
}

.benzene-ring {
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
    display: block;
}

.benzene-ring .ring-stroke {
    stroke: var(--accent-2);
    stroke-width: 1;
    fill: none;
    opacity: 0.4;
    stroke-dasharray: 280;
    stroke-dashoffset: 280;
    transition: stroke-dashoffset 0.8s var(--ease-quint);
}

.section-header.in-view .benzene-ring .ring-stroke {
    stroke-dashoffset: 0;
}

/* ----- Body prose ----- */

.section-body { position: relative; }

.prose {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.9;
    letter-spacing: 0.02em;
    color: var(--text-sec);
    margin: 0 0 36px;
    max-width: 60ch;
    position: relative;
}

.signal-body .prose,
.signal-body .signal-line {
    margin-left: auto;
    margin-right: auto;
}

.accent-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    color: var(--accent-1);
    letter-spacing: 0.04em;
    font-size: 1.08em;
}

.hot-word {
    color: var(--text-pri);
    cursor: pointer;
    border-bottom: 1px dotted rgba(212, 149, 106, 0.4);
    padding-bottom: 1px;
    transition: color 0.4s var(--ease-quint), text-shadow 0.4s var(--ease-quint);
}

.hot-word:hover {
    color: var(--halo);
    text-shadow: 0 0 12px rgba(245, 216, 154, 0.5);
}

/* Reveal-on-scroll */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease-quint), transform 0.5s var(--ease-quint);
    will-change: opacity, transform;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ----- Dot rule (carbon dot separator) ----- */

.dot-rule {
    width: 40%;
    height: 2px;
    margin: 56px auto;
    background-image:
        radial-gradient(circle, var(--surface) 0.9px, transparent 1.1px);
    background-size: 12px 2px;
    background-repeat: repeat-x;
    background-position: 0 50%;
    position: relative;
}

.dot-rule::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--accent-1) 0.9px, transparent 1.1px);
    background-size: 72px 2px;
    background-repeat: repeat-x;
    background-position: 5px 50%;
    opacity: 0.85;
}

.signal-body .dot-rule { margin-left: auto; margin-right: auto; }

/* ----- Diamond stage ----- */

.diamond-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 4;
    margin: 0 0 40px;
    background: radial-gradient(ellipse at center, rgba(53, 43, 32, 0.6), transparent 70%);
    border: 1px solid rgba(139, 107, 94, 0.18);
    border-radius: 2px;
    overflow: hidden;
}

#diamond-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.diamond-caption {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: var(--text-sec);
    opacity: 0.55;
    text-transform: lowercase;
}

/* ----- Signal section ----- */

.signal-body { padding: 0 16px; }

.signal-line {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: var(--accent-1);
    letter-spacing: 0.04em;
    margin: 0 0 64px;
    opacity: 0.85;
}

.seed-hex {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin: 0 auto 64px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-pri);
    transition: transform 0.4s var(--ease-quint);
}

.seed-hex:hover {
    transform: scale(1.04);
}

.seed-hex svg {
    width: 88px;
    height: 88px;
    overflow: visible;
}

.seed-hex svg polygon {
    stroke: var(--accent-1);
    stroke-width: 1.2;
    fill: none;
    transition: stroke 0.4s var(--ease-quint), filter 0.4s var(--ease-quint);
}

.seed-hex svg .seed-inner {
    stroke: var(--accent-2);
    opacity: 0.6;
}

.seed-hex svg circle {
    fill: var(--accent-1);
}

.seed-hex:hover svg polygon {
    stroke: var(--halo);
    filter: drop-shadow(0 0 12px rgba(245, 216, 154, 0.5));
}

.seed-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-sec);
    opacity: 0.7;
}

.colophon {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    color: var(--text-sec);
    text-transform: uppercase;
    opacity: 0.55;
    margin: 32px 0 0;
}

/* ----- Ember trail particles ----- */

.ember-pool {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
}

.ember {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent-1);
    opacity: 0;
    box-shadow: 0 0 6px rgba(212, 149, 106, 0.6);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

/* ----- Warm touch (cursor candle glow) ----- */

.warm-touch {
    position: fixed;
    width: 400px;
    height: 400px;
    margin-left: -200px;
    margin-top: -200px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(245, 216, 154, 0.10) 0%, rgba(245, 216, 154, 0.03) 40%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.4s var(--ease-quint);
    mix-blend-mode: screen;
    filter: blur(2px);
}

.warm-touch.active { opacity: 1; }

/* ----- Full pulse overlay ----- */

.full-pulse {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(245, 216, 154, 0.32) 0%, rgba(212, 149, 106, 0.10) 35%, transparent 70%);
    opacity: 0;
    mix-blend-mode: screen;
}

.full-pulse.firing {
    animation: full-pulse-fire 1.4s var(--ease-quint) forwards;
}

@keyframes full-pulse-fire {
    0%   { opacity: 0;   transform: scale(0.6); }
    20%  { opacity: 1;   transform: scale(1.0); }
    60%  { opacity: 0.6; transform: scale(1.1); }
    100% { opacity: 0;   transform: scale(1.2); }
}

/* ----- Responsive niceties ----- */

@media (max-width: 600px) {
    .section { padding: 120px 0; }
    .hero-title { font-size: 2.2rem; }
    .dot-rule { width: 70%; }
    .whisper-nav { right: 6px; }
}

::selection {
    background: rgba(212, 149, 106, 0.4);
    color: var(--halo);
}
