/* IceColdSky Core CSS */

:root {
    --ics-content-min-width: 320px; /* content column never shrinks below this */
    --ics-panel-min-width: 480px;   /* shader panel never renders smaller than this */
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
    color: #ffffff;
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

/* ── Stage: flex row — card content (flexible) + shader panel (fixed size) ── */
#ics-stage {
    position: fixed;
    top: 0;
    left: 80px;       /* same nav offset as before */
    right: 0;
    bottom: 2px;      /* same copyright offset as before */
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 24px;
    padding-right: 14px; /* recreates the old panel-to-edge margin */
    overflow: hidden;    /* if panel + content-min don't fit, panel clips — no scrollbar, ever */
    
    opacity: 0;
}

#ics-stage.ics-ready {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Card container — flexible width, but height now comes from the SAME
   shared value the panel uses (--ics-stage-height, set once by JS) —
   not an independent 100% calculation. This guarantees both elements
   are always exactly the same height. */
#ics-card-container {
    position: relative;
    flex: 1 1 auto;
    min-width: var(--ics-content-min-width);
    height: var(--ics-stage-height, 100%); /* 100% is only a pre-JS fallback */
    container-type: inline-size;
}

.ics-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.ics-card-active {
    display: flex;
    opacity: 1;
}

/* Shader panel — sized ONCE by JS (fixed pixel width/height set on this element),
   computed from the device's screen resolution, not the browser viewport.
   Never resizes after that — no %, no aspect-ratio, no observer. If the
   window is too narrow to fit it alongside the content minimum, #ics-stage's
   overflow:hidden clips it at the edge rather than shrinking or scrolling. */
#ics-shader-panel {
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 2px;
    min-width: var(--ics-panel-min-width);
    transform: translateX(-24px);  /* ← only this line added */
}

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

/* Left edge navigation */
#ics-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: calc(100% - 30px);
    z-index: 100;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.75) 0%,
        rgba(0,0,0,0.3) 70%,
        rgba(0,0,0,0.0) 100%
    );
}

#ics-nav-line {
    position: absolute;
    top: 0;
    left: 62px;
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,0.2);
}

#ics-nav-indicator {
    position: absolute;
    left: 56px;
    width: 13px;
    height: 2px;
    background: rgba(255,255,255,0.9);
    transition: top 0.4s ease;
}

#ics-nav-items {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    list-style: none;
    gap: 36px;
    padding-left: 12px;
}

.ics-nav-item {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.ics-nav-label {
    display: block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    transition: color 0.3s ease;
    user-select: none;
}

.ics-nav-item:hover .ics-nav-label,
.ics-nav-item.ics-nav-active .ics-nav-label {
    color: rgba(255,255,255,0.95);
}

/* Persistent copyright line */
#ics-copyright {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
}

#ics-copyright span {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    font-variant-numeric: lining-nums;
}

#ics-copyright .ics-copy-symbol {
    font-size: 13px;
    vertical-align: middle;
    line-height: 1;
    display: inline-block;
    transform: translateY(-0.5px);
}

/* HOME card — no more padding-right calc, container is already sized correctly */
.ics-home-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 40px;
}

.ics-home-title {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 8cqw, 4rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.92);
    text-shadow:
        0 2px 20px rgba(0,0,0,0.8),
        0 0 60px rgba(0,0,0,0.5);
    user-select: none;
    white-space: nowrap;
}

/* ABOUT card — simplified, parent .ics-card already provides the box */
.ics-about-card {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    padding: 0 24px 2px 24px;
    box-sizing: border-box;
}

.ics-about-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
}

.ics-about-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.4rem, 5cqw, 2.2rem);
    font-weight: 400;
    font-style: italic;
    color: rgba(255,255,255,0.92);
    margin: 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
}

.ics-about-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 15px;
    line-height: 1.9;
    color: rgba(255,255,255,0.82);
    white-space: pre-wrap;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.ics-about-text::-webkit-scrollbar {
    width: 4px;
}
.ics-about-text::-webkit-scrollbar-track {
    background: transparent;
}
.ics-about-text::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}
