/* ============================================
   sky. — minimal personal tech blog & portfolio
   dark + vibrant blue · serif editorial
   ============================================ */

/* --- Tokens --- */
:root {
    --bg: #070a12;
    --bg-2: #0b0f1a;
    --bg-3: #101625;

    --line: rgba(148, 163, 184, 0.14);
    --line-strong: rgba(148, 163, 184, 0.28);

    --text: #e9ecf4;
    --muted: #8a93a8;
    --dim: #64708c;

    --blue: #3d7bfd;
    --blue-bright: #6ea4ff;
    --cyan: #3fe0ff;

    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;

    --rail: 232px;
    --mh-h: 74px;
    --breeze-cycle: 30s;
    --ease: cubic-bezier(0.65, 0, 0.35, 1);
    --snap: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue); color: #06090f; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
strong { font-weight: 600; color: var(--text); }

.mono {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    color: var(--blue-bright);
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.section { padding: 64px 0; scroll-margin-top: 40px; }

/* --- Film grain --- */
.grain {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Scroll progress --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--blue);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 1000;
}

/* --- Custom cursor --- */
.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--blue);
    transform: translate(-50%, -50%);
}

.cursor-ring {
    width: 34px;
    height: 34px;
    border: 1.5px solid rgba(61, 123, 253, 0.55);
    transform: translate(var(--x, 0px), var(--y, 0px)) translate(-50%, -50%) scale(1);
    transition: transform 0.25s var(--snap), border-color 0.25s ease,
                opacity 0.3s ease, background 0.25s ease;
}

body.cursor-on .cursor-dot, body.cursor-on .cursor-ring { opacity: 1; }
body.cursor-hover .cursor-ring {
    transform: translate(var(--x, 0px), var(--y, 0px)) translate(-50%, -50%) scale(1.5);
    background: rgba(61, 123, 253, 0.08);
    border-color: var(--blue);
}

/* --- Periodic breeze gust --- */
.breeze-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.breeze-line {
    position: absolute;
    left: 0;
    color: rgba(130, 165, 255, 0.6);
    opacity: 0;
    will-change: transform;
}

.breeze-1 { top: 24%; width: 250px; --o: 0.15; animation: breeze var(--breeze-cycle, 10s) ease-in-out infinite; }
.breeze-2 { top: 48%; width: 210px; --o: 0.11; animation: breeze var(--breeze-cycle, 10s) ease-in-out 0.5s infinite; }
.breeze-3 { top: 68%; width: 230px; --o: 0.13; animation: breeze var(--breeze-cycle, 10s) ease-in-out 1s infinite; }

@keyframes breeze {
    0%   { opacity: 0; transform: translateX(-18vw) translateY(0) rotate(-4deg); }
    4%   { opacity: var(--o, 0.13); }
    18%  { opacity: var(--o, 0.13); transform: translateX(50vw) translateY(-10px) rotate(-7deg); }
    26%  { opacity: 0; transform: translateX(112vw) translateY(-18px) rotate(-7deg); }
    100% { opacity: 0; transform: translateX(112vw) translateY(-18px) rotate(-7deg); }
}

/* The 'sky.' ghost sways gently as the gust passes */
.hero-ghost {
    animation: ghostSway var(--breeze-cycle, 10s) ease-in-out infinite;
}

@keyframes ghostSway {
    0%, 26%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(0.5deg); }
    20% { transform: rotate(-0.6deg); }
}

/* ============================================
   Decorative sunflower (blue) — sits centered in
   the rail, above the submenu links. It waves
   gently at all times; every 30s an invisible wind
   gust sends petals gliding to the right across the
   screen (first 5s of the cycle).
   ============================================ */
.sunflower {
    position: absolute;
    bottom: 60px;              /* sit just above the rail clock */
    left: 0;
    width: 232px;              /* full rail width → stem + head center on x = 116 */
    height: 150px;
    z-index: 5;
    pointer-events: none;
    transform-origin: 50% 100%; /* sway pivots at the root (bottom) — plant bends, root stays put */
    animation: sunflowerSway 7s ease-in-out infinite;
}

.sunflower-stem {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 4px;
    height: 108px;
    transform: translateX(-50%);
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(61, 123, 253, 0.9), rgba(61, 123, 253, 0.08));
}

.sun-flower { /* head — centered on top of the stem */
    position: absolute;
    left: 50%;
    top: 0;
    width: 88px;
    height: 88px;
    transform: translateX(-50%);
}

.sun-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 38%, #aac9ff 0%, var(--blue) 58%, #2b5fd6 100%);
    box-shadow: 0 0 26px rgba(61, 123, 253, 0.6);
}

.sun-pet {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 15px;
    height: 27px;
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(-25px);
    transform-origin: 50% 50%;   /* == flower center → symmetric bloom, stem lines up */
    background: linear-gradient(180deg, var(--blue-bright) 0%, var(--blue) 70%, rgba(61, 123, 253, 0.4) 100%);
}

/* whole stalk leans from the root — like a flower swaying in the breeze */
@keyframes sunflowerSway {
    0%, 100% { transform: rotate(-3.2deg); }
    50%      { transform: rotate(3.2deg); }
}

/* --- flying petals that sweep across the screen during the gust --- */
.petal-scene {
    position: fixed;
    inset: 0;
    z-index: 600;
    pointer-events: none;
    overflow: hidden;
}

.fly-pet {
    position: absolute;
    width: 15px;
    height: 25px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 34%, var(--blue-bright) 0%, var(--blue) 60%, rgba(61, 123, 253, 0.45) 100%);
    box-shadow: 0 0 16px rgba(61, 123, 253, 0.35);
    opacity: 0;
    will-change: transform, opacity;
}

.fly-1 { bottom: 152px; left: 104px; animation: fly1 30s infinite; }
.fly-2 { bottom: 184px; left: 108px; animation: fly2 30s infinite; }
.fly-3 { bottom: 138px; left: 126px; animation: fly3 30s infinite; }
.fly-4 { bottom: 194px; left: 116px; animation: fly4 30s infinite; }
.fly-5 { bottom: 124px; left: 120px; animation: fly5 30s infinite; }

@keyframes fly1 {
    0%    { opacity: 0; transform: translate(0, 0) rotate(0) scale(1); }
    1.2%  { opacity: 0.9; animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    9%    { opacity: 1; transform: translate(38vw, -52px) rotate(160deg) scale(0.9); animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    16.1% { opacity: 0.85; transform: translate(84vw, 16px) rotate(330deg) scale(0.55); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.4); }
    16.7% { opacity: 0; transform: translate(90vw, 30px) rotate(350deg) scale(0.5); }
    100%  { opacity: 0; transform: translate(90vw, 30px) rotate(350deg) scale(0.5); }
}

@keyframes fly2 {
    0%    { opacity: 0; transform: translate(0, 0) rotate(0) scale(1); }
    1.6%  { opacity: 0.9; animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    10%   { opacity: 1; transform: translate(45vw, -20px) rotate(-170deg) scale(0.88); animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    16.1% { opacity: 0.85; transform: translate(88vw, -34px) rotate(190deg) scale(0.5); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.4); }
    16.7% { opacity: 0; transform: translate(92vw, -42px) rotate(210deg) scale(0.45); }
    100%  { opacity: 0; transform: translate(92vw, -42px) rotate(210deg) scale(0.45); }
}

@keyframes fly3 {
    0%    { opacity: 0; transform: translate(0, 0) rotate(0) scale(1); }
    1.1%  { opacity: 0.9; animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    8.5%  { opacity: 1; transform: translate(42vw, 18px) rotate(140deg) scale(0.85); animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    16.1% { opacity: 0.85; transform: translate(86vw, 50px) rotate(300deg) scale(0.5); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.4); }
    16.7% { opacity: 0; transform: translate(91vw, 58px) rotate(320deg) scale(0.45); }
    100%  { opacity: 0; transform: translate(91vw, 58px) rotate(320deg) scale(0.45); }
}

@keyframes fly4 {
    0%    { opacity: 0; transform: translate(0, 0) rotate(0) scale(1); }
    1.8%  { opacity: 0.9; animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    9.5%  { opacity: 1; transform: translate(40vw, -74px) rotate(-120deg) scale(0.86); animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    16.1% { opacity: 0.85; transform: translate(87vw, -8px) rotate(200deg) scale(0.48); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.4); }
    16.7% { opacity: 0; transform: translate(92vw, -16px) rotate(220deg) scale(0.42); }
    100%  { opacity: 0; transform: translate(92vw, -16px) rotate(220deg) scale(0.42); }
}

@keyframes fly5 {
    0%    { opacity: 0; transform: translate(0, 0) rotate(0) scale(1); }
    1.4%  { opacity: 0.9; animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    9%    { opacity: 1; transform: translate(48vw, 8px) rotate(120deg) scale(0.9); animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1); }
    16.1% { opacity: 0.85; transform: translate(90vw, -28px) rotate(280deg) scale(0.52); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.4); }
    16.7% { opacity: 0; transform: translate(94vw, -36px) rotate(300deg) scale(0.46); }
    100%  { opacity: 0; transform: translate(94vw, -36px) rotate(300deg) scale(0.46); }
}

@media (max-width: 1024px) {
    .sunflower, .petal-scene { display: none; }
}

/* --- Layout --- */
.main {
    /* Center the content block in the space right of the rail */
    position: relative;
    z-index: 1;
    margin-left: calc(var(--rail) + max(0px, (100vw - var(--rail) - 1320px) / 2));
    padding: 0 clamp(24px, 4vw, 64px);
    max-width: 1320px;
}

/* --- Rail --- */
.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 26px;
    border-right: 1px solid var(--line);
    background: var(--bg);
}

.rail-logo {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--text);
    width: max-content;
    line-height: 1;
}

.rail-logo-dot { color: var(--blue); }

/* Animated top-left logo video (square) */
.rail-logo-video {
    display: block;
    width: 160px;
    height: 160px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    box-shadow: 0 0 24px -10px rgba(61, 123, 253, 0.5);
}
.mobile-header .rail-logo-video {
    width: 40px;
    height: 40px;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
}




.rail-nav { display: flex; flex-direction: column; gap: 2px; }

.rail-link {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 9px 10px;
    border-radius: 6px;
    position: relative;
    transition: background 0.2s ease;
}

.rail-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: 3px;
    background: var(--blue);
    transform: translateY(-50%);
    transition: height 0.3s var(--snap);
}

.rail-link:hover { background: rgba(148, 163, 184, 0.06); }

.rail-num {
    color: var(--dim);
    font-size: 10.5px;
    transition: color 0.2s ease;
}

.rail-label {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 400;
    color: var(--muted);
    transition: color 0.2s ease, transform 0.25s var(--snap);
}

.rail-link:hover .rail-label { color: var(--text); transform: translateX(3px); }
.rail-link:hover .rail-num { color: var(--blue); }

.rail-link.active::before { height: 18px; }
.rail-link.active .rail-label { color: var(--text); }
.rail-link.active .rail-num { color: var(--blue); }

.rail-foot { display: flex; flex-direction: column; gap: 16px; }

.rail-time { color: var(--muted); font-variant-numeric: tabular-nums; display: flex; gap: 6px; }
.rail-tz { color: var(--dim); }

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(63, 224, 255, 0.8);
    animation: blink 2s ease-in-out infinite;
    margin-right: 8px;
}

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

.rail-status { display: flex; align-items: center; color: var(--muted); }
.rail-status .mono { font-size: 10.5px; }

.rail-social { display: flex; gap: 14px; }

.rail-social-link {
    color: var(--dim);
    font-size: 11px;
    transition: color 0.2s ease;
}

.rail-social-link:hover { color: var(--blue-bright); }

/* --- Mobile header + dropdown drawer --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    height: var(--mh-h);
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: rgba(7, 10, 18, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.mobile-time { color: var(--muted); font-variant-numeric: tabular-nums; }

.mobile-header-right { display: flex; align-items: center; gap: 18px; }

.drawer-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    padding: 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.drawer-toggle span {
    display: block;
    height: 1.5px;
    width: 100%;
    background: var(--text);
    transition: transform 0.3s var(--snap);
}

.drawer-toggle:hover span:first-child { transform: translateY(-1px); }
.drawer-toggle:hover span:last-child { transform: translateY(1px); }

body.drawer-open .drawer-toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
body.drawer-open .drawer-toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.drawer {
    position: fixed;
    top: var(--mh-h);
    left: 0;
    right: 0;
    z-index: 285;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 22px 20px;
    background: rgba(7, 10, 18, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s var(--snap);
}

body.drawer-open .drawer { opacity: 1; transform: none; pointer-events: auto; }

.drawer-link {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 9px 4px;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 400;
    color: var(--muted);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s var(--snap), color 0.2s ease;
}

.drawer-num { font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }

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

body.drawer-open .drawer-link { opacity: 1; transform: none; }
body.drawer-open .drawer-link:nth-child(1) { transition-delay: 0.04s; }
body.drawer-open .drawer-link:nth-child(2) { transition-delay: 0.08s; }
body.drawer-open .drawer-link:nth-child(3) { transition-delay: 0.12s; }
body.drawer-open .drawer-link:nth-child(4) { transition-delay: 0.16s; }
body.drawer-open .drawer-link:nth-child(5) { transition-delay: 0.2s; }

.drawer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.drawer-social { display: flex; flex-wrap: wrap; gap: 18px; }
.drawer-social a { color: var(--muted); font-size: 11px; transition: color 0.2s ease; }
.drawer-social a:hover { color: var(--blue-bright); }

.drawer-status { display: flex; align-items: center; color: var(--muted); font-size: 10px; }

/* --- Buttons & links --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    border-radius: 999px;
    background: var(--blue);
    color: #06090f;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, transform 0.2s var(--snap), box-shadow 0.3s ease;
    box-shadow: 0 0 0 rgba(61, 123, 253, 0);
}

.btn-primary:hover {
    background: var(--blue-bright);
    box-shadow: 0 12px 40px -10px rgba(61, 123, 253, 0.7);
}

.text-arrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 15px;
    color: var(--text);
    padding: 15px 4px;
    border-bottom: 1px solid var(--line-strong);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.text-arrow-ico { transition: transform 0.25s var(--snap); }

.text-arrow:hover { color: var(--blue-bright); border-color: var(--blue); }
.text-arrow:hover .text-arrow-ico { transform: translateX(5px); }

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: clamp(48px, 6vw, 88px);
    align-items: center;
    padding: 96px 0 72px;
    position: relative;
}

.hero-ghost {
    position: absolute;
    right: -1%;
    top: 6%;
    z-index: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(140px, 24vw, 360px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(148, 163, 184, 0.13);
    pointer-events: none;
    user-select: none;
}

.hero > *:not(.hero-ghost) { position: relative; z-index: 1; }

.hero-eyebrow {
    color: var(--muted);
    margin-bottom: 26px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(40px, 4.8vw, 92px);
    line-height: 1.02;
    letter-spacing: -0.01em;
}

.hero-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.06em;
}

.hero-title .line-inner {
    display: block;
    transform: translateY(112%);
    transition: transform 1.1s var(--snap);
}

body.loaded .hero-title .line:nth-child(1) .line-inner { transition-delay: 0.12s; }
body.loaded .hero-title .line:nth-child(2) .line-inner { transition-delay: 0.24s; }
body.loaded .line-inner { transform: translateY(0); }

.hero-sub {
    max-width: 520px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 32px;
}

.hero-rotating {
    margin-top: 30px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.rotating {
    display: grid;
    color: var(--blue-bright);
}

.rotating span {
    grid-area: 1 / 1;
    white-space: nowrap;
    transition: opacity 0.4s ease, transform 0.4s var(--snap);
}

.rotating span:not(.active) { opacity: 0; }
.rotating span.out { transform: translateY(-30%); }

/* Hero aside — compact latest writeups index */
.hero-aside {
    border-left: 1px solid var(--line);
    padding-left: clamp(24px, 3vw, 40px);
}

.aside-label {
    color: var(--dim);
    margin-bottom: 16px;
}

.aside-item {
    display: grid;
    grid-template-columns: 26px 1fr 22px;
    align-items: baseline;
    gap: 10px;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line);
}

.aside-num {
    color: var(--dim);
    font-size: 10.5px;
}

.aside-name {
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1.3;
    color: var(--text);
    transition: transform 0.3s var(--snap), color 0.2s ease;
}

.aside-item:hover .aside-name {
    transform: translateX(5px);
    color: var(--blue-bright);
}

.aside-item:hover .aside-num { color: var(--blue); }

.aside-arrow {
    color: var(--blue-bright);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.3s var(--snap);
    text-align: right;
}

.aside-item:hover .aside-arrow { opacity: 1; transform: none; }

.aside-status {
    display: flex;
    align-items: center;
    margin-top: 16px;
    color: var(--muted);
    font-size: 10.5px;
}

/* --- Marquee --- */
.marquee {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    padding: 14px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: 44px;
    padding-right: 44px;
}

.marquee-track span {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 23px;
    color: var(--text);
    white-space: nowrap;
}

.marquee-star { color: var(--blue); font-size: 14px; font-style: normal; }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --- Companies (bug-hunt) wordmark marquee --- */
.co-marquee-wrap {
    padding: 40px 0 16px;
    grid-column: 1 / -1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.co-marquee-label {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 16px;
}

.co-marquee-label::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--blue);
}

.co-marquee {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    padding: 14px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 94%, transparent);
}

.co-marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.co-marquee-group {
    display: flex;
    align-items: center;
    gap: 44px;
    padding-right: 44px;
}

/* Same typography as the top marquee — serif italic wordmarks */
.co-wm {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 23px;
    color: var(--text);
    white-space: nowrap;
    line-height: 1;
}

.co-dot {
    color: var(--blue);
    font-size: 14px;
    font-style: normal;
    line-height: 1;
}


/* --- Section heads --- */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-num { color: var(--blue); font-size: 12px; }

.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(34px, 4.5vw, 52px);
    line-height: 1.05;
}

.section-desc { color: var(--dim); font-size: 11px; }

/* --- Post list --- */
.post-list { display: flex; flex-direction: column; }

.post-row {
    display: grid;
    grid-template-columns: 44px 120px 1fr auto 36px;
    grid-template-areas: "num date name tag arrow";
    align-items: center;
    gap: 18px;
    padding: 18px 14px;
    border-bottom: 1px solid var(--line);
    position: relative;
    transition: background 0.25s ease;
}

.post-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--blue);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.3s var(--snap);
}

.post-row:hover { background: linear-gradient(90deg, rgba(61, 123, 253, 0.07), transparent 70%); }
.post-row:hover::before { transform: scaleY(1); }

.post-num { grid-area: num; color: var(--dim); font-size: 11px; transition: color 0.2s ease; }
.post-date { grid-area: date; color: var(--muted); font-size: 11px; }

.post-name {
    grid-area: name;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.3;
    color: var(--text);
    transition: transform 0.3s var(--snap), color 0.2s ease;
}

.post-row:hover .post-name { transform: translateX(6px); color: var(--blue-bright); }
.post-row:hover .post-num { color: var(--blue); }

.post-tag, .post-read {
    grid-area: tag;
    transition: opacity 0.25s ease, transform 0.25s var(--snap);
}

.post-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
}

.post-read {
    opacity: 0;
    transform: translateY(5px);
    color: var(--blue-bright);
    font-size: 11px;
}

.post-row:hover .post-tag { opacity: 0; transform: translateY(-5px); }
.post-row:hover .post-read { opacity: 1; transform: none; }

.tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    opacity: 0.7;
}

.post-arrow {
    grid-area: arrow;
    font-size: 18px;
    color: var(--blue-bright);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.3s var(--snap);
    text-align: right;
}

.post-row:hover .post-arrow { opacity: 1; transform: translateX(0); }

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 56px;
    align-items: start;
}

.about-lead {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 22px;
}

.about-bio p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 18px;
    max-width: 560px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--blue-bright);
    padding-bottom: 3px;
    background: linear-gradient(var(--blue), var(--blue)) no-repeat 0 100% / 0 1.5px;
    transition: background-size 0.35s var(--snap), color 0.2s ease;
}

.portfolio-link:hover {
    color: var(--cyan);
    background-size: 100% 1.5px;
}

.skill {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.skill:hover {
    border-color: var(--blue);
    color: var(--blue-bright);
    background: rgba(61, 123, 253, 0.07);
}

/* Facts spec sheet */
.facts {
    border-top: 1px solid var(--line);
}

.fact-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 15px 2px;
    border-bottom: 1px dotted var(--line-strong);
}

.fact-row dt {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    flex-shrink: 0;
}

.fact-row dd {
    font-size: 14.5px;
    color: var(--text);
    text-align: right;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.fact-row dd .status-dot { margin-right: 8px; }

/* --- Stats band --- */
.stats-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 48px;
}

.stat {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 22px;
    background: linear-gradient(180deg, rgba(16, 22, 37, 0.5), rgba(11, 15, 26, 0.8));
    transition: transform 0.3s var(--snap), border-color 0.25s ease, box-shadow 0.3s ease;
}

.stat:hover {
    transform: translateY(-4px);
    border-color: rgba(61, 123, 253, 0.45);
    box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.8);
}

.stat-num {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(32px, 3.6vw, 46px);
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.01em;
}

.stat-num .stat-plus { color: var(--blue); }
.stat-num.accent { color: var(--blue-bright); }

.stat-label {
    margin-top: 12px;
    color: var(--muted);
    font-size: 10px;
}

.stat-sub {
    margin-top: 5px;
    color: var(--dim);
    font-size: 12px;
    line-height: 1.5;
}

/* --- Certifications --- */
.certs { margin-top: 32px; }

.certs-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dim);
    font-size: 10.5px;
    margin-bottom: 16px;
}

.certs-label::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--blue);
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.cert-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 22px 20px;
    background: var(--bg-2);
    transition: transform 0.3s var(--snap), border-color 0.25s ease;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-card:hover {
    transform: translateY(-4px);
    border-color: rgba(61, 123, 253, 0.45);
}

.cert-card:hover::before { opacity: 1; }

.cert-badge {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(61, 123, 253, 0.12);
    border: 1px solid rgba(61, 123, 253, 0.35);
    color: var(--blue-bright);
    font-size: 9.5px;
    letter-spacing: 0.08em;
}

.cert-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 21px;
    line-height: 1.25;
    color: var(--text);
}

.cert-full {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.cert-org {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-size: 9.5px;
}

/* --- Contact --- */
.contact { padding-bottom: 80px; }

.contact-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(38px, 5.5vw, 64px);
    line-height: 1.06;
    letter-spacing: -0.01em;
    margin-top: 8px;
}

.contact-sub {
    color: var(--muted);
    font-size: 16px;
    max-width: 460px;
    margin-top: 18px;
}

.contact-email {
    display: inline-block;
    margin-top: 36px;
    font-family: var(--font-display);
    font-size: clamp(22px, 3.4vw, 32px);
    color: var(--text);
    padding-bottom: 6px;
    background: linear-gradient(var(--blue), var(--blue)) no-repeat 0 100% / 0 2px;
    transition: background-size 0.4s var(--snap), color 0.2s ease;
}

.contact-email:hover {
    color: var(--blue-bright);
    background-size: 100% 2px;
}

.contact-emails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 36px;
}
.contact-emails .contact-email { margin-top: 0; }
.contact-email.personal {
    color: var(--muted);
    font-size: clamp(15px, 2.4vw, 20px);
}
.contact-email.personal:hover { color: var(--text); }

.contact-socials {
    display: flex;
    gap: 26px;
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.contact-socials a {
    color: var(--muted);
    font-size: 11.5px;
    transition: color 0.2s ease, transform 0.2s var(--snap);
}

.contact-socials a:hover { color: var(--blue-bright); transform: translateY(-2px); }

/* --- Pentesting services --- */
.services { padding-bottom: 88px; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: stretch;
}

.service-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(16, 22, 37, 0.55), rgba(11, 15, 26, 0.85));
    padding: 32px 32px 28px;
    transition: transform 0.35s var(--snap), border-color 0.3s ease, box-shadow 0.4s ease;
}

/* cursor-tracking spotlight (--mx/--my set from JS) */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 0%), rgba(61, 123, 253, 0.15), transparent 55%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(61, 123, 253, 0.45);
    box-shadow: 0 28px 60px -28px rgba(0, 0, 0, 0.85), 0 0 44px -16px rgba(61, 123, 253, 0.4);
}

.service-card:hover::before { opacity: 1; }

.service-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.service-num { color: var(--blue); font-size: 11.5px; }

.service-mode {
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--blue-bright);
    font-size: 9.5px;
    letter-spacing: 0.12em;
}

.service-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(27px, 3vw, 34px);
    line-height: 1.12;
    color: var(--text);
    letter-spacing: -0.01em;
}

.service-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    line-height: 1.4;
    color: var(--blue-bright);
    margin-top: 14px;
}

.service-desc {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.75;
    margin-top: 14px;
}

.service-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.service-list li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.service-list li::before {
    content: '✦';
    color: var(--blue);
    font-size: 10px;
    flex-shrink: 0;
}

.service-need {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: rgba(61, 123, 253, 0.05);
}

.service-need-label { color: var(--dim); font-size: 9.5px; }

.service-need p {
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.55;
    margin-top: 5px;
}

.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 26px 0 3px;
    width: fit-content;
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--blue-bright);
    background: linear-gradient(var(--blue), var(--blue)) no-repeat 0 100% / 0 1.5px;
    transition: background-size 0.35s var(--snap), color 0.2s ease;
}

.service-cta:hover { color: var(--cyan); background-size: 100% 1.5px; }

/* Included-in-both strip */
.service-common {
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px 30px 28px;
    background: var(--bg-2);
}

.service-common-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dim);
    font-size: 10.5px;
    margin-bottom: 20px;
}

.service-common-label::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--blue);
}

.service-common-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.common-item h4 {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.25;
    color: var(--text);
}

.common-item h4::before {
    content: '✦';
    color: var(--blue);
    font-size: 10px;
    flex-shrink: 0;
}

.common-item p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.65;
    margin-top: 8px;
}

/* Second-opinion challenge badge */
.service-badge {
    position: relative;
    overflow: hidden;
    margin-top: 24px;
    border: 1px solid rgba(61, 123, 253, 0.4);
    border-radius: 16px;
    padding: 36px 38px 38px;
    background:
        radial-gradient(700px 260px at 88% -10%, rgba(61, 123, 253, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(16, 22, 37, 0.85), rgba(11, 15, 26, 0.95));
}

.service-badge::after {
    content: '50%';
    position: absolute;
    right: -16px;
    bottom: -44px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(130px, 17vw, 230px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(61, 123, 253, 0.16);
    pointer-events: none;
    user-select: none;
}

.service-badge-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--blue);
    font-size: 10.5px;
}

.service-badge-label::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--blue);
}

.service-badge-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(25px, 3.4vw, 38px);
    line-height: 1.15;
    color: var(--text);
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.service-badge-sub {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
    margin-top: 12px;
    max-width: 580px;
    position: relative;
    z-index: 1;
}

.badge-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 26px;
    max-width: 820px;
    position: relative;
    z-index: 1;
}

.badge-rule {
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 18px 20px;
    background: rgba(7, 10, 18, 0.55);
}

.badge-rule-tag { color: var(--dim); font-size: 9.5px; }

.badge-rule-line {
    font-family: var(--font-display);
    font-size: 25px;
    line-height: 1.2;
    color: var(--text);
    margin-top: 8px;
}

.badge-rule:nth-child(2) .badge-rule-line { color: var(--blue-bright); }

.badge-rule-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 6px;
}

.badge-note {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    margin-left: calc(var(--rail) + max(0px, (100vw - var(--rail) - 1320px) / 2));
    padding: 0 clamp(24px, 4vw, 64px) 28px;
    max-width: 1320px;
}

.footer-ghost {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(64px, 10vw, 150px);
    line-height: 0.85;
    text-align: center;
    color: transparent;
    -webkit-text-stroke: 1px rgba(148, 163, 184, 0.11);
    pointer-events: none;
    user-select: none;
    margin-bottom: 6px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer-top { color: var(--muted); transition: color 0.2s ease; }
.footer-top:hover { color: var(--blue-bright); }

/* --- Article / post page --- */
.article-main {
    padding-top: 48px;
    padding-bottom: 96px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    color: var(--muted);
    font-size: 11.5px;
    transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover { color: var(--blue-bright); gap: 12px; }

.article-header {
    margin-bottom: 44px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    margin-bottom: 18px;
}

.article-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.article-loading { color: var(--muted); }

.article-body {
    max-width: 720px;
    font-size: 16.5px;
    line-height: 1.85;
    color: var(--muted);
}

.article-body > * + * { margin-top: 1.05em; }

.article-body h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.2;
    color: var(--text);
    margin-top: 2em;
}

.article-body h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 23px;
    line-height: 1.25;
    color: var(--text);
    margin-top: 1.6em;
}

.article-body a {
    color: var(--blue-bright);
    border-bottom: 1px solid rgba(61, 123, 253, 0.4);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.article-body a:hover { color: var(--cyan); border-color: var(--blue); }

.article-body strong { color: var(--text); font-weight: 600; }

.article-body code {
    font-family: var(--font-mono);
    font-size: 0.84em;
    color: var(--blue-bright);
    background: rgba(126, 153, 255, 0.08);
    border: 1px solid var(--line);
    padding: 2px 6px;
    border-radius: 6px;
}

.article-body pre {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    overflow-x: auto;
}

.article-body pre code {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.7;
}

.article-body blockquote {
    border-left: 3px solid var(--blue);
    padding: 4px 0 4px 20px;
    color: var(--muted);
    font-style: italic;
}

.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body li::marker { color: var(--blue); }

.article-body hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2.5em 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.article-body th, .article-body td {
    border: 1px solid var(--line);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
}

.article-body th {
    color: var(--text);
    background: var(--bg-2);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-body img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
}

/* --- Reveal on scroll --- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s var(--snap);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* --- Floating comment widget --- */
.comment-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.comment-widget.awake {
    opacity: 1;
    visibility: visible;
}

/* trigger bubble */
.comment-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(11, 15, 26, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7), 0 0 30px -12px rgba(61, 123, 253, 0.45);
    transition: border-color 0.25s ease, transform 0.3s var(--snap), box-shadow 0.3s ease;
}

.comment-trigger:hover {
    border-color: rgba(61, 123, 253, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 18px 48px -14px rgba(0, 0, 0, 0.8), 0 0 36px -10px rgba(61, 123, 253, 0.55);
}

.comment-avatar-trigger {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(61, 123, 253, 0.4);
    animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(61, 123, 253, 0.35); }
    50% { box-shadow: 0 0 0 7px rgba(61, 123, 253, 0); }
}

.comment-widget.open .comment-avatar-trigger { animation: none; }

.comment-trigger-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.comment-trigger-name {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text);
}

.comment-trigger-status { color: var(--muted); font-size: 9px; }

.comment-chev {
    color: var(--blue-bright);
    font-size: 13px;
    transition: transform 0.3s var(--snap);
}

.comment-widget.open .comment-chev { transform: rotate(180deg); }

/* popup panel */
.comment-panel {
    width: min(360px, calc(100vw - 32px));
    max-height: 460px;
    display: flex;
    flex-direction: column;
    background: rgba(11, 15, 26, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 0 40px -18px rgba(61, 123, 253, 0.4);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px) scale(0.97);
    transform-origin: bottom right;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.35s var(--snap), visibility 0s linear 0.35s;
}

.comment-widget.open .comment-panel {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.3s ease, transform 0.35s var(--snap);
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.comment-avatar-head {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    flex-shrink: 0;
}

.comment-head-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.comment-head-name {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment-head-status {
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 9px;
}

.comment-head-status .status-dot { width: 6px; height: 6px; margin-right: 6px; }

.comment-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.comment-close:hover {
    color: var(--text);
    border-color: var(--blue);
    background: rgba(61, 123, 253, 0.1);
}

.comment-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.comment-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: commentIn 0.4s var(--snap) both;
}

@keyframes commentIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.comment-avatar-msg {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    flex-shrink: 0;
    margin-top: 2px;
}

.comment-meta {
    color: var(--dim);
    font-size: 9.5px;
    margin-bottom: 4px;
}

.comment-bubble {
    background: linear-gradient(180deg, rgba(61, 123, 253, 0.16), rgba(61, 123, 253, 0.07));
    border: 1px solid rgba(61, 123, 253, 0.35);
    border-radius: 4px 14px 14px 14px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.6;
}

.comment-typing {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 14px;
    width: max-content;
}

.comment-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    animation: typingDot 1.2s ease-in-out infinite;
}

.comment-typing span:nth-child(2) { animation-delay: 0.15s; }
.comment-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.comment-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-size: 9.5px;
}

.comment-replay {
    color: var(--blue-bright);
    font-size: 9.5px;
    transition: color 0.2s ease;
}

.comment-replay:hover { color: var(--cyan); }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .rail { display: none; }
    .main { margin-left: 0; padding-top: calc(var(--mh-h) + 16px); }
    .footer { margin-left: 0; }
    .mobile-header { display: flex; }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 40px 0 56px;
    }

    .hero-aside {
        border-left: none;
        border-top: 1px solid var(--line);
        padding: 24px 0 0;
    }

    .service-common-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-band { grid-template-columns: repeat(3, 1fr); }

    .section { padding: 48px 0; scroll-margin-top: calc(var(--mh-h) + 16px); }
}

@media (max-width: 720px) {
    .post-row {
        grid-template-columns: 32px 1fr auto;
        grid-template-areas:
            "num name arrow"
            "num date tag";
        row-gap: 8px;
        padding: 18px 8px;
    }

    .post-num { align-self: start; padding-top: 5px; }
    .post-name { font-size: 19px; }
    .post-arrow { opacity: 1; transform: none; font-size: 15px; }
    .post-date { grid-area: date; }
    .post-tag { justify-self: end; }
    .post-read { justify-self: end; }

    .about-grid { grid-template-columns: 1fr; gap: 48px; }
    .about-lead { font-size: 21px; }

    .hero-actions { flex-direction: column; align-items: flex-start; gap: 18px; }

    .hero-ghost { font-size: 110px; }

    .co-marquee-wrap { padding: 48px 0 8px; }
    .co-marquee { padding: 12px 0; }
    .co-marquee-group { gap: 30px; padding-right: 30px; }

    .section-head { flex-wrap: wrap; row-gap: 6px; }

    .footer-inner { flex-direction: column; text-align: center; }

    .article-body table {
        display: block;
        overflow-x: auto;
    }

    .services-grid { grid-template-columns: 1fr; }
    .service-card { padding: 26px 22px; }
    .service-common { padding: 22px 20px; }
    .service-common-grid { grid-template-columns: 1fr; gap: 20px; }
    .service-badge { padding: 26px 22px 30px; }
    .badge-rules { grid-template-columns: 1fr; }
    .stats-band { grid-template-columns: 1fr; }
    .certs-grid { grid-template-columns: 1fr; }

    .comment-widget { right: 16px; bottom: 16px; }
    .comment-panel { width: min(280px, calc(100vw - 24px)); max-height: 45vh; }

    /* chat-style: compact circular DP + notification dot, no text */
    .comment-trigger {
        position: relative;
        width: 48px;
        height: 48px;
        padding: 0;
        gap: 0;
        border-radius: 50%;
        justify-content: center;
    }
    .comment-trigger-info,
    .comment-trigger-status,
    .comment-chev { display: none; }
    .comment-trigger::after {
        content: "";
        position: absolute;
        right: 6px;
        bottom: 6px;
        width: 12px;
        height: 12px;
        border: 2px solid rgba(11, 15, 26, 0.85);
        border-radius: 50%;
        background: var(--blue-bright);
        box-shadow: 0 0 0 2px rgba(11, 15, 26, 0.9);
    }
    .comment-widget.open .comment-trigger::after { display: none; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .cursor-dot, .cursor-ring { display: none; }
    .breeze-layer { display: none; }
    .sunflower, .petal-scene { display: none; }

    .marquee-track { animation: none; }
    .co-marquee-track { animation: none; }
    .status-dot { animation: none; }
    .comment-avatar-trigger { animation: none; }
    .comment-typing span { animation: none; }
    .comment-row { animation: none; }

    .line-inner { transform: none !important; }

    .reveal { opacity: 1; transform: none; }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}
