/* ============================================================
   layer-2.id v2 — Editorial blockchain identity document
   Palette: #8a8578 #2d6a4f #3b5998 #f5f2ec #e8e4de #5c584e #1e1e1a
   Fonts:   Space Mono · Source Serif 4 · IBM Plex Mono
   ============================================================ */

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

html, body {
    background: #e8e4de;
    color: #1e1e1a;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(ellipse at 50% 0%,  rgba(245,242,236,0.55), transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(245,242,236,0.35), transparent 60%),
        #e8e4de;
}

/* shared monospace utility for technical labels */
.section-no,
.section-tag,
.meta-tick,
.hero-footnote,
.hex-meta,
.layer-margin,
.verify-label,
.verify-tick,
.verify-hash {
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    color: #8a8578;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background: #e8e4de;
    padding: 32px 48px 40px;
    display: flex;
    flex-direction: column;
}

.hero-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    z-index: 3;
    position: relative;
}

.meta-tick {
    color: #8a8578;
    letter-spacing: 0.12em;
}

.hero-net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* central hexagon - draws side-by-side via stroke-dashoffset */
.central-hex {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: drawHex 900ms cubic-bezier(0.6,0.05,0.3,0.95) 200ms forwards;
}

@keyframes drawHex {
    from { stroke-dashoffset: 1200; }
    to   { stroke-dashoffset: 0;    }
}

.inner-hex {
    opacity: 0;
    animation: fadeIn 500ms ease 1100ms forwards;
}

.net-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    opacity: 0.6;
    animation: drawLine 600ms ease forwards;
}

.net-line[data-stagger="0"] { animation-delay: 1100ms; }
.net-line[data-stagger="1"] { animation-delay: 1200ms; }
.net-line[data-stagger="2"] { animation-delay: 1300ms; }
.net-line[data-stagger="3"] { animation-delay: 1400ms; }
.net-line[data-stagger="4"] { animation-delay: 1500ms; }
.net-line[data-stagger="5"] { animation-delay: 1600ms; }

@keyframes drawLine {
    from { stroke-dashoffset: 600; }
    to   { stroke-dashoffset: 0;   }
}

.sat {
    opacity: 0;
    animation: fadeIn 400ms ease forwards;
}
.sat:nth-child(1) { animation-delay: 1700ms; }
.sat:nth-child(2) { animation-delay: 1800ms; }
.sat:nth-child(3) { animation-delay: 1900ms; }
.sat:nth-child(4) { animation-delay: 2000ms; }
.sat:nth-child(5) { animation-delay: 2100ms; }
.sat:nth-child(6) { animation-delay: 2200ms; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* hex glow pulse */
.central-hex.glow-pulse {
    animation:
        drawHex 900ms cubic-bezier(0.6,0.05,0.3,0.95) 200ms forwards,
        glowPulse 800ms ease 1300ms 1;
}

@keyframes glowPulse {
    0%   { filter: drop-shadow(0 0 0 rgba(59,89,152,0)); }
    50%  { filter: drop-shadow(0 0 18px rgba(59,89,152,0.35)); }
    100% { filter: drop-shadow(0 0 0 rgba(59,89,152,0)); }
}

/* hero text */
.hero-text {
    position: relative;
    z-index: 2;
    margin: auto;
    text-align: center;
    padding: 0 24px;
}

.hero-title {
    font-family: 'Space Mono', 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: clamp(36px, 7vw, 88px);
    color: #1e1e1a;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    display: inline-flex;
    align-items: baseline;
    min-height: 1.1em;
}

.hero-cursor {
    display: inline-block;
    color: #1e1e1a;
    margin-left: 4px;
    animation: blink 800ms steps(2, start) infinite;
    font-family: inherit;
    font-weight: 400;
}

@keyframes blink {
    0%, 50%   { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.hero-id {
    display: block;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(14px, 1.6vw, 18px);
    color: #3b5998;
    letter-spacing: 0.18em;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(6px);
    animation: idAppear 500ms ease forwards;
    animation-delay: 1300ms;
    text-transform: lowercase;
}

@keyframes idAppear {
    to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
    margin: 28px auto 0;
    max-width: 30em;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(15px, 1.4vw, 18px);
    color: #5c584e;
    font-style: italic;
    opacity: 0;
    animation: fadeIn 600ms ease forwards 2000ms;
}

.hero-footnote {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #8a8578;
    margin-top: auto;
}

.hero-footnote .dotline {
    flex: 0 1 100px;
    height: 1px;
    border-bottom: 1px dotted #8a8578;
    opacity: 0.6;
}

/* ============================================================
   SECTION HEADER (shared)
   ============================================================ */

.section-header {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: baseline;
    gap: 16px;
    padding: 0 48px;
    margin-bottom: 56px;
}

.section-no {
    font-size: 12px;
    color: #8a8578;
}

.section-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(24px, 3.4vw, 38px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e1e1a;
}

.section-rule {
    height: 1px;
    background: #8a8578;
    opacity: 0.55;
    margin: 0 4px;
}

.section-tag {
    font-size: 11px;
    color: #8a8578;
    text-align: right;
}

/* ============================================================
   PROTOCOL — Honeycomb tessellated grid
   ============================================================ */

.protocol {
    padding: 120px 0 140px;
    position: relative;
    background: #e8e4de;
}

.honeycomb {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 1080px;
    padding: 0 48px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.hex-row-b {
    margin-top: -78px;
    margin-bottom: -78px;
}

.hex-cell {
    --hex-w: 308px;
    --hex-h: 356px;
    width: var(--hex-w);
    height: var(--hex-h);
    position: relative;
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #8a8578;
    color: #5c584e;
    transition: transform 350ms ease, color 350ms ease;
    opacity: 0;
    transform: scale(0.92) translateY(8px);
    will-change: opacity, transform;
}

.hex-cell.is-revealed {
    animation: hexReveal 500ms cubic-bezier(0.2,0.7,0.2,1) forwards;
}

@keyframes hexReveal {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hex-cell:hover {
    transform: scale(1.02);
    color: #1e1e1a;
}

.hex-cell.hex-active {
    color: #3b5998;
}

.hex-inner {
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    margin: 2px;
    background: #f5f2ec;
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 44px;
    gap: 12px;
}

.hex-cell.hex-active .hex-inner {
    background: #f5f2ec;
    box-shadow: inset 0 0 0 1px rgba(59,89,152,0.18);
}

.hex-icon {
    width: 36px;
    height: 36px;
    color: #8a8578;
    flex-shrink: 0;
}

.hex-cell.hex-active .hex-icon {
    color: #3b5998;
}

.hex-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e1e1a;
}

.hex-cell.hex-active .hex-title {
    color: #3b5998;
}

.hex-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 13px;
    line-height: 1.55;
    color: #5c584e;
    max-width: 22em;
    font-weight: 400;
}

.hex-meta {
    font-size: 10px;
    letter-spacing: 0.14em;
}

/* connection lines overlay */
.honeycomb-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.honeycomb-connections line {
    stroke: #8a8578;
    stroke-width: 1;
    opacity: 0;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: opacity 400ms ease, stroke-dashoffset 600ms ease;
}

.honeycomb-connections line.is-drawn {
    opacity: 0.6;
    stroke-dashoffset: 0;
}

/* ============================================================
   STACK — Editorial vertical flow
   ============================================================ */

.stack {
    background: #f5f2ec;
    padding: 140px 0 160px;
    border-top: 1px solid rgba(138,133,120,0.35);
    border-bottom: 1px solid rgba(138,133,120,0.35);
}

.stack-layer {
    position: relative;
    max-width: 40em;
    margin: 0 auto 120px;
    padding: 0 32px;
}

.stack-layer:last-child { margin-bottom: 0; }

.stack-layer::before {
    /* margin annotation - rendered via attr() data-margin */
    content: attr(data-margin);
    position: absolute;
    top: 0.3em;
    left: calc(100% + 32px);
    width: 22ch;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #8a8578;
    text-transform: uppercase;
    line-height: 1.55;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 400ms ease, transform 400ms ease;
    pointer-events: none;
}

.stack-layer.is-active::before {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 1100px) {
    .stack-layer::before {
        position: static;
        display: block;
        width: auto;
        margin-bottom: 12px;
        opacity: 1;
        transform: none;
    }
}

.layer-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(20px, 2.6vw, 28px);
    color: #1e1e1a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 24px;
}

.layer-lead {
    font-size: clamp(17px, 1.7vw, 21px);
    line-height: 1.65;
    color: #1e1e1a;
    margin-bottom: 24px;
    font-weight: 400;
}

.layer-lead em {
    font-style: italic;
    color: #3b5998;
    font-weight: 600;
}

.stack-layer p {
    font-size: clamp(16px, 1.5vw, 18px);
    color: #5c584e;
    line-height: 1.75;
    margin-bottom: 24px;
}

.stack-layer p em {
    color: #1e1e1a;
    font-style: italic;
}

.pull-quote {
    border-left: 3px solid #3b5998;
    padding: 8px 0 8px 28px;
    margin: 36px 0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 600;
    line-height: 1.4;
    color: #1e1e1a;
    font-style: italic;
}

/* ============================================================
   VERIFY — Footer hexagonal stamp
   ============================================================ */

.verify {
    position: relative;
    min-height: 88vh;
    padding: 100px 24px 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e4de;
    overflow: hidden;
}

.verify-hex-svg {
    position: absolute;
    width: min(88vmin, 600px);
    height: min(88vmin, 600px);
    z-index: 1;
}

.verify-hex {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 1100ms cubic-bezier(0.6,0.05,0.3,0.95);
}

.verify-hex.is-drawn { stroke-dashoffset: 0; }

.verify-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 48px 24px;
    max-width: 28em;
}

.verify-label {
    font-size: 11px;
    color: #8a8578;
    display: block;
    margin-bottom: 14px;
}

.verify-stamp {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 64px);
    color: #2d6a4f;
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.verify-meta {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    color: #5c584e;
    font-size: 15px;
    margin-bottom: 28px;
}

.verify-hash {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #1e1e1a;
    letter-spacing: 0.04em;
    word-break: break-all;
    background: rgba(245,242,236,0.6);
    padding: 12px 18px;
    border: 1px solid rgba(138,133,120,0.4);
    margin-bottom: 24px;
    text-transform: lowercase;
    min-height: 2.6em;
}

.verify-tick {
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #8a8578;
    display: block;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
    .hex-row-b { margin-top: -70px; margin-bottom: -70px; }
    .hex-cell { --hex-w: 260px; --hex-h: 300px; }
    .hex-inner { padding: 40px 28px; }
}

@media (max-width: 760px) {
    .hero { padding: 24px 24px 32px; }
    .section-header {
        padding: 0 24px;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "no title"
            "tag tag";
        gap: 12px;
    }
    .section-no   { grid-area: no; }
    .section-title{ grid-area: title; }
    .section-rule { display: none; }
    .section-tag  { grid-area: tag; text-align: left; }

    .honeycomb {
        gap: 18px;
        padding: 0 32px;
    }
    .hex-row, .hex-row-a, .hex-row-b {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        margin: 0;
    }
    .hex-cell { --hex-w: 280px; --hex-h: 320px; }
    .honeycomb-connections { display: none; }

    .stack { padding: 90px 0 100px; }
    .stack-layer { padding: 0 24px; margin-bottom: 80px; }

    .verify { padding: 80px 16px; min-height: 72vh; }
    .hero-footnote { font-size: 10px; gap: 10px; }
}
