/* =================================================================
   KUMASUM.COM — Kashim Uddin Masum
   Founder & CEO, Dream Group / DreamIT
   Hand-crafted design system · dark + light · motion-first
   ================================================================= */

/* ---------- Fonts ---------- */
/* Loaded via <link> in <head>: Space Grotesk (display) + Inter (body) */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* =================================================================
   DESIGN TOKENS
   ================================================================= */
:root {
  /* brand — Midnight + Amber */
  --brand:        #f5b53d;   /* amber accent */
  --brand-2:      #e09a1f;   /* deeper amber for gradients/hover */
  --brand-glow:   245, 181, 61;
  --on-brand:     #0b1020;   /* text/icons on an amber fill */

  /* dark theme (default) — deep navy-black */
  --bg:        #0b1020;
  --bg-2:      #0e1426;
  --surface:   #131a2e;
  --surface-2: #18203a;
  --elevated:  #1d2747;
  --text:      #eef2fb;
  --text-2:    #aeb8d2;
  --muted:     #8591ad;
  --line:      rgba(255,255,255,.09);
  --line-2:    rgba(255,255,255,.16);
  --glass:     rgba(255,255,255,.04);
  --glass-2:   rgba(255,255,255,.08);
  --tile:      #ffffff;      /* logo tiles always read perfectly */
  --shadow:    0 30px 70px -25px rgba(0,0,0,.7);
  --invert:    0;

  /* aurora (decorative background glows) */
  --a1: #f5b53d; --a2: #3f6bff; --a3: #6c8bff;
  --a4: #f08a3c; --a5: #2bb39a; --a6: #ffd166;

  /* type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* fluid scale */
  --step--1: clamp(.78rem, .74rem + .2vw, .9rem);
  --step-0:  clamp(.95rem, .9rem + .25vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.05rem + .5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.1rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.6vw, 4.8rem);
  --step-5:  clamp(3.4rem, 2.1rem + 6.4vw, 8.5rem);

  /* layout */
  --maxw: 1240px;
  --gut: clamp(1.15rem, 4vw, 3rem);
  --radius: 22px;
  --radius-lg: 30px;
  --ease: cubic-bezier(.22,1,.36,1);
  --ease-2: cubic-bezier(.65,.05,.36,1);
}

[data-theme="light"] {
  /* deeper ochre accent so amber reads on light surfaces (WCAG-AA) */
  --brand:     #a86a09;
  --brand-2:   #8a560a;
  --brand-glow: 168, 106, 9;
  --on-brand:  #ffffff;

  --bg:        #f7f5ef;   /* warm off-white */
  --bg-2:      #efebe0;
  --surface:   #ffffff;
  --surface-2: #fbf9f4;
  --elevated:  #ffffff;
  --text:      #15171d;
  --text-2:    #454b58;
  --muted:     #6c7280;
  --line:      rgba(16,18,26,.10);
  --line-2:    rgba(16,18,26,.17);
  --glass:     rgba(255,255,255,.6);
  --glass-2:   rgba(255,255,255,.8);
  --tile:      #ffffff;
  --shadow:    0 30px 60px -28px rgba(20,22,40,.26);
  --invert:    1;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}
body.no-scroll { overflow: hidden; }

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.02; letter-spacing: -.02em; }

::selection { background: var(--brand); color: var(--on-brand); }

/* grain + vignette overlay */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .035; mix-blend-mode: overlay;
}

/* =================================================================
   LAYOUT
   ================================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { position: relative; padding: clamp(5rem, 9vw, 9rem) 0; z-index: 2; }
.section--tight { padding-block: clamp(3rem, 6vw, 6rem); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--brand);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--brand); opacity: .7; }
.section-head { max-width: 760px; margin-bottom: clamp(2.4rem, 5vw, 4rem); }
.section-head h2 { font-size: var(--step-4); margin: .5em 0 .35em; }
.section-head p { color: var(--text-2); font-size: var(--step-1); max-width: 56ch; }

.text-grad {
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 28%, var(--brand) 66%, var(--brand-2) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  --pad-y: .95em; --pad-x: 1.6em;
  position: relative; display: inline-flex; align-items: center; gap: .6em;
  padding: var(--pad-y) var(--pad-x);
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-0);
  letter-spacing: -.01em; border: 0; border-radius: 100px; cursor: pointer;
  background: var(--surface); color: var(--text);
  transition: transform .4s var(--ease), background .3s, color .3s, box-shadow .4s;
  will-change: transform;
}
.btn svg { width: 1.1em; height: 1.1em; transition: transform .4s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: var(--on-brand); font-weight: 700; box-shadow: 0 16px 40px -14px rgba(var(--brand-glow), .65);
}
.btn--primary svg { stroke: var(--on-brand); }
.btn--primary:hover { box-shadow: 0 22px 55px -12px rgba(var(--brand-glow), .8); }
.btn--ghost { background: var(--glass); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn--ghost:hover { background: var(--glass-2); border-color: var(--brand); }
.btn--lg { --pad-y: 1.15em; --pad-x: 2em; font-size: var(--step-1); }

/* =================================================================
   CURSOR
   ================================================================= */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; }
.cursor-dot { width: 7px; height: 7px; background: #fff; transform: translate(-50%,-50%); }
.cursor-ring {
  width: 38px; height: 38px; border: 1.5px solid #fff; transform: translate(-50%,-50%);
  transition: width .3s var(--ease), height .3s var(--ease), background .3s, opacity .3s;
}
.cursor-ring.is-hover { width: 64px; height: 64px; background: rgba(255,255,255,.12); }
.cursor-ring.is-down { width: 26px; height: 26px; }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* =================================================================
   SCROLL PROGRESS + PRELOADER
   ================================================================= */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9000;
  background: linear-gradient(90deg, var(--brand), #ff8a5c, var(--a2)); }

.preloader {
  position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center;
  background: var(--bg); transition: opacity .8s var(--ease), visibility .8s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.pre-inner { text-align: center; }
.pre-mark { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.5rem,9vw,5rem);
  letter-spacing: -.04em; color: var(--text); display: flex; gap: .04em; }
.pre-mark span { opacity: 0; transform: translateY(120%); display: inline-block;
  animation: preUp .7s var(--ease) forwards; }
.pre-mark span:nth-child(2){animation-delay:.06s} .pre-mark span:nth-child(3){animation-delay:.12s}
.pre-mark span:nth-child(4){animation-delay:.18s} .pre-mark span:nth-child(5){animation-delay:.24s}
.pre-mark .dot { color: var(--brand); }
.pre-bar { width: min(240px,60vw); height: 2px; background: var(--line); margin: 1.4rem auto 0; overflow: hidden; border-radius: 2px; }
.pre-bar i { display:block; height:100%; width:0; background: var(--brand); transition: width .2s linear; }
.pre-pct { margin-top:.8rem; font-family: var(--font-display); font-size: var(--step--1); color: var(--muted); letter-spacing:.2em; }
@keyframes preUp { to { opacity:1; transform: translateY(0);} }

/* =================================================================
   NAV
   ================================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(.8rem,2vw,1.3rem) var(--gut);
  transition: transform .5s var(--ease), background .4s, border-color .4s, padding .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border-bottom-color: var(--line);
}
.nav.hide { transform: translateY(-110%); }
.nav-logo { display: flex; align-items: center; gap: .65rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.nav-logo .mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 8px 20px -8px rgba(var(--brand-glow),.7); }
.nav-logo b { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: clamp(1rem,2.2vw,2.1rem); }
.nav-links a { font-size: var(--step--1); font-weight: 500; color: var(--text-2); position: relative; padding: .3rem 0; transition: color .3s; }
.nav-links a::after { content:""; position:absolute; left:0; bottom:-2px; width:0; height:2px; background: var(--brand); transition: width .35s var(--ease); }
.nav-links a:hover { color: var(--text); } .nav-links a:hover::after { width:100%; }
.nav-right { display: flex; align-items: center; gap: .8rem; }

.theme-toggle {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--glass); display: grid; place-items: center; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color .3s, background .3s, transform .5s var(--ease);
}
.theme-toggle:hover { border-color: var(--brand); transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; } .theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: block; } [data-theme="light"] .theme-toggle .moon { display: none; }

.menu-btn { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--glass); cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.menu-btn span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .35s var(--ease); }
.menu-btn.open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2){ opacity: 0; }
.menu-btn.open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 999; background: color-mix(in srgb, var(--bg) 96%, transparent);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  display: grid; place-content: center; gap: 1.2rem; text-align: center;
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility .5s; }
.drawer.open { opacity: 1; visibility: visible; }
.drawer a { font-family: var(--font-display); font-size: clamp(1.8rem,7vw,2.6rem); font-weight: 600; color: var(--text); transform: translateY(20px); opacity: 0; transition: .5s var(--ease); }
.drawer.open a { transform: translateY(0); opacity: 1; }
.drawer.open a:nth-child(2){transition-delay:.05s} .drawer.open a:nth-child(3){transition-delay:.1s}
.drawer.open a:nth-child(4){transition-delay:.15s} .drawer.open a:nth-child(5){transition-delay:.2s}
.drawer.open a:nth-child(6){transition-delay:.25s}
.drawer a:hover { color: var(--brand); }

/* =================================================================
   HERO
   ================================================================= */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding-top: 7rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .85fr; gap: clamp(2rem,5vw,4rem); align-items: center; width: 100%; }

.hero-eyebrow { margin-bottom: 1.4rem; }
.hero h1 { font-size: var(--step-5); font-weight: 700; letter-spacing: -.045em; margin-bottom: 1.2rem; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; transform: translateY(110%); }
.hero-role { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.1rem; font-size: var(--step-1); color: var(--text-2); margin-bottom: 1.6rem; }
.hero-role .pill { font-family: var(--font-display); font-weight: 600; color: var(--text); padding: .35em .9em; border-radius: 100px; border: 1px solid var(--line-2); background: var(--glass); font-size: var(--step--1); letter-spacing: .02em; }
.hero-role .dotsep { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.hero-sub { max-width: 50ch; color: var(--text-2); font-size: var(--step-1); margin-bottom: 2.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero-scroll { position: absolute; bottom: 1.6rem; left: var(--gut); display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: var(--step--1); font-family: var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.hero-scroll .mouse { width: 22px; height: 36px; border: 1.5px solid var(--line-2); border-radius: 12px; position: relative; }
.hero-scroll .mouse::before { content:""; position:absolute; top:6px; left:50%; transform: translateX(-50%); width:3px; height:7px; border-radius:2px; background: var(--brand); animation: scrollWheel 1.6s var(--ease) infinite; }
@keyframes scrollWheel { 0%{opacity:0; transform: translate(-50%,0)} 30%{opacity:1} 100%{opacity:0; transform: translate(-50%,12px)} }

/* portrait */
.hero-portrait { position: relative; justify-self: center; }
.portrait-frame {
  position: relative; width: clamp(260px, 32vw, 400px); aspect-ratio: 4/5; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  background: var(--surface);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: saturate(1.05) contrast(1.03); transition: transform .8s var(--ease); }
.hero-portrait:hover .portrait-frame img { transform: scale(1.05); }
.portrait-frame::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45)); }
.portrait-ring { position: absolute; inset: -14px; border-radius: calc(var(--radius-lg) + 14px); border: 1px solid var(--line); pointer-events:none;
  background: conic-gradient(from 0deg, transparent, rgba(var(--brand-glow),.5), transparent 30%); animation: spin 8s linear infinite; opacity:.6; }
@keyframes spin { to { transform: rotate(360deg); } }
.portrait-badge {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-radius: 100px;
  background: var(--elevated); border: 1px solid var(--line-2); box-shadow: var(--shadow); white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: var(--step--1);
}
.portrait-badge img { width: 22px; height: 22px; border-radius: 6px; }
.portrait-badge .live { width: 8px; height: 8px; border-radius: 50%; background: #1fb35a; box-shadow: 0 0 0 0 rgba(31,179,90,.6); animation: ping 1.8s infinite; }
@keyframes ping { 0%{box-shadow:0 0 0 0 rgba(31,179,90,.5)} 70%{box-shadow:0 0 0 10px rgba(31,179,90,0)} 100%{box-shadow:0 0 0 0 rgba(31,179,90,0)} }

/* floating product orbs */
.orb { position: absolute; border-radius: 16px; overflow: hidden; background: var(--tile); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.06); display: grid; place-items: center; padding: 8px; will-change: transform; }
.orb img { width: 100%; height: 100%; object-fit: contain; }
.orb.o1 { width: 64px; height: 64px; top: 6%; right: 12%; }
.orb.o2 { width: 54px; height: 54px; top: 60%; right: 2%; }
.orb.o3 { width: 58px; height: 58px; bottom: 4%; left: 2%; }
.orb.o4 { width: 48px; height: 48px; top: 28%; left: -4%; }
@media (max-width: 980px){ .orb { display: none; } }

/* aurora background */
.aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; mix-blend-mode: screen; will-change: transform; }
[data-theme="light"] .aurora .blob { opacity: .42; mix-blend-mode: multiply; filter: blur(80px); }
.aurora .b1 { width: 46vw; height: 46vw; background: var(--a1); top: -12%; left: -6%; animation: float1 16s var(--ease) infinite alternate; }
.aurora .b2 { width: 40vw; height: 40vw; background: var(--a2); top: 8%; right: -10%; animation: float2 19s var(--ease) infinite alternate; }
.aurora .b3 { width: 38vw; height: 38vw; background: var(--a3); bottom: -16%; left: 18%; animation: float3 22s var(--ease) infinite alternate; }
.aurora .b4 { width: 26vw; height: 26vw; background: var(--a4); bottom: -8%; right: 14%; animation: float1 18s var(--ease) infinite alternate; }
@keyframes float1 { to { transform: translate(8%, 10%) scale(1.15); } }
@keyframes float2 { to { transform: translate(-10%, 12%) scale(1.1); } }
@keyframes float3 { to { transform: translate(12%, -8%) scale(1.2); } }

/* =================================================================
   MARQUEE
   ================================================================= */
.marquee-sec { padding-block: clamp(2.2rem,5vw,3.4rem); border-block: 1px solid var(--line); position: relative; z-index: 2; background: var(--bg-2); }
.marquee-label { text-align: center; color: var(--muted); font-family: var(--font-display); font-size: var(--step--1); letter-spacing: .24em; text-transform: uppercase; margin-bottom: 1.8rem; }
.marquee { display: flex; gap: 1rem; width: max-content; animation: scrollX 42s linear infinite; }
.marquee-sec:hover .marquee { animation-play-state: paused; }
.marquee-track { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
@keyframes scrollX { to { transform: translateX(-50%); } }
.m-chip { flex: 0 0 auto; height: 78px; min-width: 150px; padding: 0 1.5rem; border-radius: 16px; background: var(--tile); display: grid; place-items: center; box-shadow: 0 10px 30px -18px rgba(0,0,0,.5); }
.m-chip img { height: 42px; width: auto; object-fit: contain; }

/* =================================================================
   WHAT I BUILD
   ================================================================= */
.build-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1rem,1.6vw,1.4rem); }
.build-card { position: relative; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: clamp(1.5rem,2.6vw,2.2rem); overflow: hidden; transition: border-color .4s, transform .5s var(--ease), background .4s; }
.build-card::before { content:""; position:absolute; inset:0; background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), rgba(var(--c,255,59,59), .14), transparent 60%); opacity:0; transition: opacity .4s; }
.build-card:hover { transform: translateY(-6px); border-color: var(--line-2); }
.build-card:hover::before { opacity: 1; }
.build-card .num { font-family: var(--font-display); font-size: var(--step--1); color: var(--brand); letter-spacing: .1em; }
.build-card h3 { font-size: var(--step-2); margin: 1.4rem 0 .6rem; }
.build-card p { color: var(--text-2); font-size: var(--step-0); }
.build-card .tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.build-card .tags span { font-size: var(--step--1); color: var(--text-2); padding: .3em .8em; border: 1px solid var(--line-2); border-radius: 100px; }
.build-card .ic { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--line-2); color: var(--brand); }
.build-card .ic svg { width: 26px; height: 26px; }
.bc-1 { grid-column: span 6; } .bc-2 { grid-column: span 6; }
.bc-3 { grid-column: span 4; } .bc-4 { grid-column: span 4; } .bc-5 { grid-column: span 4; }
@media (max-width: 820px){ .build-card { grid-column: 1/-1 !important; } }

/* =================================================================
   ECOSYSTEM
   ================================================================= */
.eco-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.4rem; }
.eco-filter { font-family: var(--font-display); font-weight: 500; font-size: var(--step--1); padding: .55em 1.1em; border-radius: 100px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2); cursor: pointer; transition: .3s var(--ease); }
.eco-filter:hover { color: var(--text); border-color: var(--brand); }
.eco-filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.eco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: clamp(1rem,1.6vw,1.4rem); }
.eco-card {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); padding: 1.5rem; overflow: hidden;
  transition: transform .15s var(--ease), border-color .4s, box-shadow .4s, opacity .4s;
  transform-style: preserve-3d; will-change: transform;
}
.eco-card::before { content:""; position:absolute; inset:0; opacity:0; transition: opacity .45s;
  background: radial-gradient(360px circle at 50% -10%, rgba(var(--c), .22), transparent 65%); }
.eco-card:hover { border-color: rgba(var(--c), .55); box-shadow: 0 30px 60px -30px rgba(var(--c), .5); }
.eco-card:hover::before { opacity: 1; }
.eco-card.hide { display: none; }
.eco-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; transform: translateZ(30px); }
.eco-logo { width: 70px; height: 70px; border-radius: 16px; background: var(--tile); display: grid; place-items: center; padding: 10px; box-shadow: 0 12px 26px -16px rgba(0,0,0,.6); }
.eco-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.eco-cat { font-family: var(--font-display); font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--c)); padding: .35em .8em; border-radius: 100px; border: 1px solid rgba(var(--c), .35); background: rgba(var(--c), .08); }
.eco-card h3 { font-size: var(--step-2); margin-bottom: .35rem; transform: translateZ(24px); }
.eco-card p { color: var(--text-2); font-size: var(--step-0); transform: translateZ(18px); min-height: 3em; }
.eco-domain { display: inline-flex; align-items: center; gap: .45em; margin-top: 1.1rem; font-family: var(--font-display); font-size: var(--step--1); color: var(--muted); transition: color .3s; }
.eco-card:hover .eco-domain { color: rgb(var(--c)); }
.eco-domain svg { width: 14px; height: 14px; }

/* =================================================================
   STATS
   ================================================================= */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem,2vw,2rem); border-block: 1px solid var(--line); padding-block: clamp(2.6rem,5vw,4rem); }
.stat { text-align: center; }
.stat .n { font-family: var(--font-display); font-weight: 700; font-size: var(--step-4); letter-spacing: -.03em; line-height: 1; }
.stat .n .text-grad { display: inline-block; }
.stat .l { color: var(--text-2); font-size: var(--step-0); margin-top: .6rem; }
@media (max-width: 720px){ .stats { grid-template-columns: repeat(2,1fr); gap: 2rem 1rem; } }

/* =================================================================
   SOLVED (impact)
   ================================================================= */
.solve-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.solve-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: clamp(1rem,3vw,2.5rem); align-items: center;
  padding: clamp(1.6rem,3vw,2.4rem) 0; border-bottom: 1px solid var(--line);
  position: relative; transition: padding .4s var(--ease);
}
.solve-row::before { content:""; position:absolute; inset:0; background: linear-gradient(90deg, rgba(var(--c),.10), transparent 50%); opacity:0; transition: opacity .4s; z-index:-1; border-radius: 14px; }
.solve-row:hover { padding-inline: clamp(.6rem,2vw,1.6rem); }
.solve-row:hover::before { opacity: 1; }
.solve-no { font-family: var(--font-display); font-size: var(--step-2); color: var(--muted); font-weight: 700; }
.solve-main h3 { font-size: var(--step-3); margin-bottom: .4rem; transition: color .3s; }
.solve-row:hover .solve-main h3 { color: rgb(var(--c)); }
.solve-main p { color: var(--text-2); max-width: 60ch; }
.solve-logos { display: flex; }
.solve-logos span { width: 46px; height: 46px; border-radius: 12px; background: var(--tile); margin-left: -12px; display: grid; place-items: center; padding: 6px; box-shadow: 0 8px 18px -10px rgba(0,0,0,.5); border: 2px solid var(--surface); transition: transform .3s var(--ease); }
.solve-logos span:first-child { margin-left: 0; }
.solve-row:hover .solve-logos span { transform: translateY(-3px); }
.solve-logos img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 760px){ .solve-row { grid-template-columns: 50px 1fr; } .solve-logos { display: none; } }

/* =================================================================
   PHILOSOPHY
   ================================================================= */
.philo-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(1rem,1.6vw,1.4rem); counter-reset: ph; }
.philo-card { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem,2.4vw,2rem); background: var(--surface); position: relative; overflow: hidden; transition: transform .5s var(--ease), border-color .4s; }
.philo-card:hover { transform: translateY(-6px); border-color: var(--brand); }
.philo-card .step { font-family: var(--font-display); font-weight: 700; font-size: var(--step-3); color: transparent; -webkit-text-stroke: 1.4px var(--line-2); }
.philo-card h3 { font-size: var(--step-2); margin: 1rem 0 .6rem; }
.philo-card p { color: var(--text-2); font-size: var(--step-0); }
@media (max-width: 920px){ .philo-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .philo-grid { grid-template-columns: 1fr; } }

/* =================================================================
   ABOUT
   ================================================================= */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem,5vw,4.5rem); align-items: center; }
.about-photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); aspect-ratio: 4/4.6; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.about-quote { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; letter-spacing: -.02em; line-height: 1.18; margin-bottom: 1.6rem; }
.about-quote .text-grad { font-style: italic; }
.about-body p { color: var(--text-2); font-size: var(--step-1); margin-bottom: 1.1rem; }
.about-sign { margin-top: 1.8rem; }
.about-sign .name { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; }
.about-sign .role { color: var(--muted); font-size: var(--step-0); }
@media (max-width: 880px){ .about-grid { grid-template-columns: 1fr; } .about-photo { max-width: 420px; } }

/* =================================================================
   CONTACT / CTA
   ================================================================= */
.cta { position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: clamp(2.5rem,6vw,5rem); border: 1px solid var(--line-2); background: var(--surface); }
.cta .aurora { position: absolute; z-index: 0; }
.cta-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
.cta h2 { font-size: var(--step-4); margin-bottom: 1rem; }
.cta p { color: var(--text-2); font-size: var(--step-1); max-width: 44ch; margin-bottom: 2rem; }
.cta-meta { display: flex; flex-direction: column; gap: 1rem; }
.cta-link { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; border-radius: 16px; border: 1px solid var(--line-2); background: var(--glass); transition: .35s var(--ease); }
.cta-link:hover { border-color: var(--brand); transform: translateX(6px); background: var(--glass-2); }
.cta-link .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--elevated); border: 1px solid var(--line); color: var(--brand); flex: 0 0 auto; }
.cta-link .ic svg { width: 20px; height: 20px; }
.cta-link .t { font-size: var(--step--1); color: var(--muted); }
.cta-link .v { font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); color: var(--text); word-break: break-all; }
@media (max-width: 860px){ .cta-inner { grid-template-columns: 1fr; } }

/* contact form (contact page) */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .5rem; }
.field label { font-family: var(--font-display); font-size: var(--step--1); color: var(--text-2); letter-spacing: .04em; }
.field input, .field textarea { background: var(--glass); border: 1px solid var(--line-2); border-radius: 14px; padding: .95rem 1.1rem; color: var(--text); font-size: var(--step-0); transition: border-color .3s, background .3s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); background: var(--glass-2); }
.field textarea { min-height: 140px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px){ .form-row { grid-template-columns: 1fr; } }

/* =================================================================
   FOOTER
   ================================================================= */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); background: var(--bg-2); padding-top: clamp(3rem,6vw,5rem); }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(1.5rem,3vw,3rem); padding-bottom: 3rem; }
.footer-brand .nav-logo { font-size: 1.4rem; margin-bottom: 1.2rem; }
.footer-brand p { color: var(--text-2); max-width: 38ch; }
.footer-col h4 { font-family: var(--font-display); font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.2rem; }
.footer-col a { display: block; color: var(--text-2); padding: .35rem 0; transition: color .3s, transform .3s; }
.footer-col a:hover { color: var(--brand); transform: translateX(4px); }
.footer-socials { display: flex; gap: .7rem; margin-top: 1.4rem; }
.footer-socials a { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-2); transition: .35s var(--ease); }
.footer-socials a:hover { color: var(--on-brand); background: var(--brand); border-color: var(--brand); transform: translateY(-4px); }
.footer-socials svg { width: 20px; height: 20px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 1.8rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }
.footer-bottom a:hover { color: var(--brand); }
@media (max-width: 820px){ .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1/-1; } }

.to-top { position: fixed; right: clamp(1rem,3vw,2rem); bottom: clamp(1rem,3vw,2rem); width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; cursor: pointer; box-shadow: 0 16px 36px -12px rgba(var(--brand-glow),.7); opacity: 0; visibility: hidden; transform: translateY(20px); transition: .45s var(--ease); z-index: 900; border: 0; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-4px) scale(1.05); }
.to-top svg { width: 22px; height: 22px; }

/* =================================================================
   REVEAL ANIMATIONS
   ================================================================= */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"]{transition-delay:.08s} .reveal[data-d="2"]{transition-delay:.16s}
.reveal[data-d="3"]{transition-delay:.24s} .reveal[data-d="4"]{transition-delay:.32s}
.reveal[data-d="5"]{transition-delay:.4s} .reveal[data-d="6"]{transition-delay:.48s}
.reveal-clip { clip-path: inset(0 100% 0 0); transition: clip-path 1s var(--ease); }
.reveal-clip.in { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; } .reveal-clip { clip-path: none; }
  .hero h1 .line > span { transform: none; }
}

/* =================================================================
   PAGE HEADER (sub pages)
   ================================================================= */
.page-hero { padding-top: clamp(8rem, 16vh, 12rem); padding-bottom: clamp(2rem,5vw,4rem); position: relative; overflow: hidden; }
.page-hero h1 { font-size: var(--step-5); letter-spacing: -.045em; }
.page-hero p { color: var(--text-2); font-size: var(--step-1); max-width: 56ch; margin-top: 1.2rem; }
.crumb { display:flex; gap:.5rem; align-items:center; color: var(--muted); font-size: var(--step--1); margin-bottom: 1.4rem; font-family: var(--font-display); letter-spacing:.04em; }
.crumb a:hover { color: var(--brand); }

/* =================================================================
   RESPONSIVE NAV / HERO
   ================================================================= */
@media (max-width: 980px){
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-portrait { order: -1; margin-bottom: 1rem; }
  .hero-role, .hero-cta { justify-content: center; }
  .hero-sub { margin-inline: auto; }
  .hero-scroll { display: none; }
}
@media (max-width: 860px){
  .nav-links { display: none; }
  .menu-btn { display: flex; }
}
@media (max-width: 480px){
  .nav-logo span.full { display: none; }
}

/* ---- mobile performance: lighten heavy GPU effects ---- */
@media (max-width: 860px){
  body::before { display: none; }                 /* drop full-screen grain blend */
  .aurora .blob { filter: blur(50px); opacity: .42; }
  .aurora .b3, .aurora .b4 { display: none; }     /* fewer big blurs on phones */
  .portrait-ring { animation-duration: 14s; }
}

/* =================================================================
   BOOKS — shelf, 3D covers, app-style reader
   ================================================================= */
.books-hero { position: relative; overflow: hidden; min-height: 60vh; }
.books-hero .aurora { position: absolute; z-index: 0; }
.books-hero .wrap { position: relative; z-index: 2; }

.book-shelf {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: clamp(2.5rem, 6vw, 4.5rem);
}
@media (max-width: 1100px){ .book-shelf { grid-template-columns: 1fr; } }

.book-card {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1.4rem, 3vw, 2.4rem);
  align-items: center; padding: clamp(1.4rem, 3vw, 2.4rem);
  border-radius: var(--radius-lg); border: 1px solid var(--line-2);
  background: var(--surface); position: relative; overflow: hidden;
  transition: border-color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.book-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(520px 320px at 20% 0%, rgba(var(--bc), .16), transparent 65%);
  transition: opacity .5s var(--ease);
}
.book-card:hover { border-color: rgba(var(--bc), .55); transform: translateY(-6px); box-shadow: var(--shadow); }
.book-card:hover::before { opacity: 1; }
@media (max-width: 560px){ .book-card { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* ---- 3D cover ---- */
.book-3d { position: relative; cursor: pointer; perspective: 1200px; width: clamp(150px, 18vw, 200px); flex: 0 0 auto; outline-offset: 6px; }
.book-cover {
  position: relative; aspect-ratio: 5 / 7.2; transform-style: preserve-3d;
  transform: rotateY(-22deg); transition: transform .6s var(--ease);
}
.book-3d:hover .book-cover, .book-3d:focus-visible .book-cover { transform: rotateY(-8deg) translateY(-6px); }
.bc-face {
  position: absolute; inset: 0; border-radius: 4px 12px 12px 4px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 11% 10%;
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(var(--bc), .55), transparent 55%),
    linear-gradient(155deg, #15151d 0%, #0c0c12 55%, rgba(var(--bc), .28) 130%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 8px 0 14px -10px rgba(0,0,0,.9);
}
.bc-face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.10) 46%, transparent 56%);
}
.bc-spine {
  position: absolute; top: 1px; bottom: 1px; left: -9px; width: 10px;
  transform: rotateY(-78deg); transform-origin: right;
  background: linear-gradient(180deg, rgba(var(--bc), .8), rgba(var(--bc), .35));
  border-radius: 3px 0 0 3px;
}
.bc-pages {
  position: absolute; top: 3px; bottom: 3px; right: -7px; width: 8px;
  transform: rotateY(70deg); transform-origin: left;
  background: repeating-linear-gradient(180deg, #e8e6df 0 2px, #cfccc2 2px 3px);
  border-radius: 0 2px 2px 0;
}
.bc-top { display: flex; justify-content: flex-end; }
.bc-lang {
  font-family: var(--font-display); font-size: .58rem; font-weight: 600; letter-spacing: .1em;
  padding: .28em .8em; border-radius: 99px; color: #fff;
  background: rgba(var(--bc), .85); white-space: nowrap;
}
.bc-kicker { font-family: var(--font-display); font-size: .56rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: .5em; }
.bc-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.45rem, 2.2vw, 1.9rem); line-height: .95; color: #fff; letter-spacing: -.01em; }
.bc-rule { width: 34%; height: 2px; margin: .7em 0; background: linear-gradient(90deg, rgb(var(--bc)), transparent); }
.bc-sub { font-size: .6rem; line-height: 1.5; color: rgba(255,255,255,.66); max-width: 16ch; }
.bc-author { font-family: var(--font-display); font-size: .62rem; font-weight: 600; letter-spacing: .06em; color: rgba(255,255,255,.85); }
.book-glow {
  position: absolute; left: 8%; right: 8%; bottom: -14px; height: 22px; border-radius: 50%;
  background: rgba(var(--bc), .45); filter: blur(18px); opacity: .6;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.book-3d:hover .book-glow { opacity: .95; transform: scaleX(1.06); }

/* ---- meta ---- */
.book-tag {
  display: inline-block; font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
  letter-spacing: .08em; color: rgb(var(--bc)); border: 1px solid rgba(var(--bc), .4);
  border-radius: 99px; padding: .2em 1em; margin-bottom: .9rem; background: rgba(var(--bc), .08);
}
.book-meta { position: relative; z-index: 2; }
.book-meta h3 { font-size: var(--step-2); margin-bottom: .7rem; }
.book-meta h3 em { font-style: normal; color: var(--text-2); font-weight: 600; }
.book-meta p { color: var(--text-2); max-width: 42ch; margin-bottom: 1.5rem; }
.book-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
@media (max-width: 560px){ .book-actions { justify-content: center; } .book-meta p { margin-inline: auto; } }
.book-more { text-align: center; margin-top: clamp(2.5rem, 6vw, 4rem); color: var(--muted); }
.book-more a { color: var(--brand); font-weight: 600; }
.book-more a:hover { text-decoration: underline; }

/* ---- reader overlay (app feel) ---- */
.reader {
  position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column;
  background: var(--bg); opacity: 0; visibility: hidden; transform: translateY(24px) scale(.985);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
.reader.open { opacity: 1; visibility: visible; transform: none; }
.reader-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(.8rem, 3vw, 1.6rem); border-bottom: 1px solid var(--line-2);
  background: var(--surface); flex: 0 0 auto;
}
.reader-title { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); min-width: 0; }
.reader-title svg { width: 20px; height: 20px; color: var(--brand); flex: 0 0 auto; }
.reader-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-actions { display: flex; align-items: center; gap: .55rem; flex: 0 0 auto; }
.reader-btn {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 600; color: var(--text-2);
  border: 1px solid var(--line-2); background: var(--glass); border-radius: 12px; padding: .55rem .9rem;
  transition: .3s var(--ease);
}
.reader-btn:hover { color: var(--text); border-color: var(--brand); background: var(--glass-2); }
.reader-btn svg { width: 16px; height: 16px; }
.reader-close { padding: .55rem .65rem; }
.reader-close:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
@media (max-width: 560px){ .reader-btn span { display: none; } .reader-btn { padding: .55rem .65rem; } }
.reader-body { position: relative; flex: 1 1 auto; background: #28282e; }
.reader-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reader-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .8rem;
  color: var(--text-2); font-family: var(--font-display); background: var(--bg-2); z-index: 2;
  transition: opacity .4s var(--ease), visibility .4s;
}
.reader-loading.done { opacity: 0; visibility: hidden; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* nav active state */
.nav-links a.active { color: var(--brand); }

/* =================================================================
   LIBRARY — auth, reader, profile  (added for the book platform)
   ================================================================= */

/* ---------- shared spinner ---------- */
.kr-spin { width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--brand);
  display: inline-block; animation: spin .8s linear infinite; vertical-align: middle; }

/* ---------- Toasts ---------- */
.kum-toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 6000; display: flex; flex-direction: column; gap: .55rem; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.kum-toast { pointer-events: auto; padding: .8rem 1.15rem; border-radius: 14px; font-size: var(--step--1); font-weight: 600;
  background: var(--elevated); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); opacity: 0; transform: translateY(14px) scale(.96); transition: .35s var(--ease); }
.kum-toast.in { opacity: 1; transform: none; }
.kum-toast--success { border-color: rgba(31,179,90,.6); }
.kum-toast--error { border-color: rgba(var(--brand-glow),.7); }

/* ---------- Account chip in nav ---------- */
.kum-acct { display: flex; align-items: center; }
.kum-acct__chip { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .8rem .35rem .35rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--glass); transition: .3s var(--ease); }
.kum-acct__chip:hover { border-color: var(--brand); background: var(--glass-2); }
.kum-acct__avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--on-brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.kum-acct__name { font-weight: 600; font-size: var(--step--1); max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kum-acct__login { padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass);
  font-weight: 600; font-size: var(--step--1); cursor: pointer; transition: .3s var(--ease); }
.kum-acct__login:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 880px){ .kum-acct__name { display: none; } .kum-acct__chip { padding: .3rem; } }
.kum-acct-drawer { /* inside mobile drawer, inherits drawer link styles */ }

/* ---------- Auth modal ---------- */
.kum-auth { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 1.2rem;
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s; }
.kum-auth.open { opacity: 1; visibility: visible; }
.kum-auth__scrim { position: absolute; inset: 0; background: rgba(4,4,7,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.kum-auth__card { position: relative; width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); padding: clamp(1.6rem, 4vw, 2.4rem); box-shadow: var(--shadow);
  transform: translateY(18px) scale(.97); transition: transform .4s var(--ease); max-height: 92vh; overflow: auto; }
.kum-auth.open .kum-auth__card { transform: none; }
.kum-auth__x { position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--glass); cursor: pointer; display: grid; place-items: center; color: var(--text-2); transition: .25s; }
.kum-auth__x:hover { color: var(--text); border-color: var(--brand); }
.kum-auth__x svg { width: 16px; height: 16px; }
.kum-auth__brand { font-family: var(--font-display); font-weight: 700; color: var(--muted); font-size: var(--step--1); letter-spacing: .02em; }
.kum-auth__brand b { color: var(--brand); }
.kum-auth__title { font-size: var(--step-2); margin: .5rem 0 .35rem; }
.kum-auth__sub { color: var(--text-2); font-size: var(--step--1); margin-bottom: 1.3rem; }
.kum-auth__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: .3rem; margin-bottom: 1.2rem; }
.kum-auth__tab { padding: .6rem; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; transition: .25s; }
.kum-auth__tab.is-active { background: var(--elevated); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0,0,0,.4); }
.kum-auth__form { display: flex; flex-direction: column; gap: .7rem; }
.kum-field { position: relative; display: flex; align-items: center; }
.kum-field__icon { position: absolute; left: 14px; color: var(--muted); display: grid; place-items: center; pointer-events: none; }
.kum-field__icon svg { width: 18px; height: 18px; }
.kum-field input { width: 100%; padding: .9rem 1rem .9rem 2.9rem; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font-size: var(--step-0); transition: border-color .25s, box-shadow .25s; }
.kum-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-glow),.18); }
.kum-field__eye { position: absolute; right: 8px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.kum-field__eye:hover { color: var(--text); }
.kum-field__eye svg { width: 18px; height: 18px; }
.kum-auth__err { color: var(--brand); font-size: var(--step--1); min-height: 1.1em; font-weight: 600; }
.kum-auth__submit { justify-content: center; margin-top: .3rem; position: relative; }
.kum-auth__submit.is-loading .kum-auth__submit-label { opacity: 0; }
.kum-auth__spinner { display: none; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(11,16,32,.35); border-top-color: var(--on-brand); animation: spin .8s linear infinite; }
.kum-auth__submit.is-loading .kum-auth__spinner { display: block; }
.kum-auth__fine { color: var(--muted); font-size: .76rem; text-align: center; margin-top: 1rem; }

/* ---------- Book card: progress + skeleton ---------- */
.book-prog { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 0 0 .5rem; max-width: 320px; }
.book-prog i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgb(var(--bc)), var(--brand)); transition: width .6s var(--ease); }
.book-prog-label { display: block; font-size: var(--step--1); color: var(--text-2); margin-bottom: 1.1rem; }
@media (max-width: 560px){ .book-prog { margin-inline: auto; } }
.book-empty { text-align: center; color: var(--muted); padding: 3rem 0; grid-column: 1 / -1; }
.book-card--skel { pointer-events: none; }
.bk-skel-cover { width: clamp(150px,18vw,200px); aspect-ratio: 3/4; border-radius: 12px; background: var(--glass-2); }
.bk-skel-meta { display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.bk-skel-meta span { height: 14px; border-radius: 8px; background: var(--glass-2); }
.bk-skel-meta span:nth-child(1){ width: 30%; } .bk-skel-meta span:nth-child(2){ width: 70%; height: 26px; } .bk-skel-meta span:nth-child(3){ width: 90%; }
.book-card--skel .bk-skel-cover, .book-card--skel .bk-skel-meta span { animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { 0%,100%{ opacity:.5 } 50%{ opacity:1 } }

/* =================================================================
   READER (PDF.js fullscreen)
   ================================================================= */
.kreader { position: fixed; inset: 0; z-index: 4000; display: flex; flex-direction: column;
  background: var(--bg); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
  --kr-accent: 245,181,61; }
.kreader.open { opacity: 1; visibility: visible; }

.kr-top { display: flex; align-items: center; gap: .8rem; padding: .6rem clamp(.7rem, 2vw, 1.2rem);
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 3; flex: 0 0 auto; }
.kr-icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--glass); color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: .25s; position: relative; }
.kr-icon:hover { color: var(--text); border-color: var(--brand); background: var(--glass-2); }
.kr-icon svg { width: 19px; height: 19px; }
.kr-titlewrap { min-width: 0; display: flex; flex-direction: column; margin-right: auto; }
.kr-title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.kr-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.kr-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgb(var(--kr-accent)), var(--brand)); transition: width .4s var(--ease); }
.kr-top-actions { display: flex; gap: .45rem; flex: 0 0 auto; }
.kr-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--brand); color: var(--on-brand); font-size: .65rem; font-weight: 700; display: grid; place-items: center; }

.kr-stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.kr-scroll { position: absolute; inset: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start;
  padding: clamp(14px, 3vw, 30px) 14px 96px; -webkit-overflow-scrolling: touch; }
.kr-page { position: relative; border-radius: 4px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.6); background: #fff; }
.kr-page canvas { display: block; border-radius: 4px; transition: filter .3s ease; }
.kr-page .textLayer { position: absolute; inset: 0; overflow: hidden; opacity: 1; line-height: 1; }
.kr-page .textLayer ::selection { background: rgba(var(--kr-accent), .35); }

/* reading themes */
.kr-stage[data-kr-theme-target="dark"]  { background: #0e0e12; }
.kr-stage[data-kr-theme-target="dark"]  .kr-page canvas { filter: invert(1) hue-rotate(180deg); }
.kr-stage[data-kr-theme-target="dark"]  .kr-page { box-shadow: 0 24px 60px -20px rgba(0,0,0,.85); }
.kr-stage[data-kr-theme-target="sepia"] { background: #d9c9a6; }
.kr-stage[data-kr-theme-target="sepia"] .kr-page canvas { filter: sepia(.45) contrast(.96) brightness(1.02); }
.kr-stage[data-kr-theme-target="light"] { background: #dcdee3; }

.kr-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .7rem;
  color: var(--text); font-family: var(--font-display); background: var(--bg); z-index: 5; text-align: center; padding: 1.5rem; }
.kr-loading[hidden] { display: none; }

.kr-selpop { position: absolute; z-index: 6; transform: translateX(-50%); }
.kr-selpop button { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 11px;
  background: var(--brand); color: var(--on-brand); border: 0; font-weight: 700; font-size: var(--step--1); cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(var(--brand-glow),.8); white-space: nowrap; }
.kr-selpop button svg { width: 15px; height: 15px; }
.kr-selpop button:hover { background: var(--brand-2); }

.kr-controls { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: .35rem; padding: .4rem; border-radius: 16px;
  background: var(--elevated); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.kr-cbtn { min-width: 40px; height: 40px; padding: 0 .6rem; border-radius: 11px; border: 0; background: transparent;
  color: var(--text); cursor: pointer; display: grid; place-items: center; font-weight: 600; font-size: var(--step--1); transition: .2s; }
.kr-cbtn:hover { background: var(--glass-2); }
.kr-cbtn svg { width: 18px; height: 18px; }
.kr-pagepick { display: flex; align-items: center; gap: .35rem; color: var(--text-2); font-size: var(--step--1); padding: 0 .3rem; }
.kr-pagepick input { width: 48px; text-align: center; padding: .45rem; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.kr-pagepick input::-webkit-outer-spin-button, .kr-pagepick input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kr-zoom { display: flex; align-items: center; gap: .2rem; margin-left: .25rem; padding-left: .35rem; border-left: 1px solid var(--line); }
.kr-fit { font-size: .8rem; }

/* key-points panel */
.kr-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 88vw); z-index: 8;
  background: var(--surface); border-left: 1px solid var(--line-2); display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .35s var(--ease); box-shadow: -20px 0 50px -25px rgba(0,0,0,.6); }
.kreader.panel-open .kr-panel { transform: none; }
.kr-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.kr-panel-head h4 { font-size: var(--step-1); }
.kr-panel-list { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.kr-empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.kr-empty svg { width: 34px; height: 34px; margin: 0 auto 1rem; color: var(--line-2); }
.kr-empty b { color: var(--text-2); }
.kr-pt { border: 1px solid var(--line); border-radius: 13px; padding: .7rem .8rem; background: var(--bg-2); cursor: pointer; transition: .2s; }
.kr-pt:hover { border-color: rgba(var(--kr-accent),.6); }
.kr-pt__top { display: flex; align-items: center; gap: .5rem; }
.kr-pt__kind { font-size: .72rem; font-weight: 700; color: var(--brand); }
.kr-pt__kind.is-bm { color: var(--a6); }
.kr-pt__pg { font-size: .72rem; color: var(--muted); margin-left: auto; }
.kr-pt__del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 2px 5px; border-radius: 6px; }
.kr-pt__del:hover { color: var(--brand); background: var(--glass-2); }
.kr-pt__txt { margin-top: .4rem; font-size: var(--step--1); color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 560px){
  .kr-sub { display: none; }
  .kr-controls { gap: .15rem; padding: .35rem; bottom: 12px; }
  .kr-cbtn { min-width: 36px; height: 36px; }
  .kr-fit { display: none; }
}

/* =================================================================
   PROFILE / MY LIBRARY
   ================================================================= */
.profile-sec { position: relative; padding-top: clamp(6rem, 12vw, 9rem); min-height: 80vh; }
.profile-loading { display: flex; align-items: center; justify-content: center; gap: .7rem; color: var(--text-2); padding: 5rem 0; font-family: var(--font-display); }

/* gate (logged out) */
.profile-gate { max-width: 540px; margin: 2rem auto; text-align: center; padding: clamp(2rem,5vw,3.5rem);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pg-mark { font-family: var(--font-display); font-weight: 700; color: var(--muted); margin-bottom: 1rem; }
.pg-mark b { color: var(--brand); }
.profile-gate h1 { font-size: var(--step-3); margin-bottom: .8rem; }
.profile-gate p { color: var(--text-2); margin-bottom: 1.8rem; }
.pg-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* header */
.profile-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1rem, 3vw, 1.8rem);
  padding: clamp(1.3rem, 3vw, 2rem); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: var(--surface); margin-bottom: 2rem; }
.ph-avatar { width: clamp(58px, 9vw, 78px); height: clamp(58px, 9vw, 78px); border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--on-brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 14px 34px -10px rgba(var(--brand-glow),.6); }
.ph-id { min-width: 0; }
.ph-nameline { display: flex; align-items: center; gap: .6rem; }
.ph-nameline h1 { font-size: var(--step-2); overflow: hidden; text-overflow: ellipsis; }
.ph-edit { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2); cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.ph-edit:hover { color: var(--text); border-color: var(--brand); }
.ph-edit svg { width: 15px; height: 15px; }
.ph-email { color: var(--text-2); font-size: var(--step--1); }
.ph-since { color: var(--muted); font-size: .8rem; }
.ph-stats { display: flex; gap: clamp(.8rem,2vw,1.6rem); }
.ph-stats div { text-align: center; }
.ph-stats b { display: block; font-family: var(--font-display); font-size: var(--step-2); color: var(--text); }
.ph-stats span { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ph-out { padding: .6rem 1.1rem; }

.profile-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.2rem, 3vw, 2rem); align-items: start; }
.profile-h2 { font-size: var(--step-1); margin-bottom: 1.1rem; }

/* continue-reading cards */
.pl-list { display: flex; flex-direction: column; gap: 1rem; }
.pl-card { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; padding: 1rem; border: 1px solid var(--line-2);
  border-radius: var(--radius); background: var(--surface); transition: .25s; }
.pl-card:hover { border-color: rgba(var(--bc),.55); }
.pl-cover { width: 78px; aspect-ratio: 3/4; border-radius: 9px; padding: .55rem; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, rgba(var(--bc),1), rgba(var(--bc),.6)); box-shadow: 0 10px 26px -10px rgba(var(--bc),.7); }
.pl-cover__lang { font-size: .5rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.pl-cover__t { font-family: var(--font-display); font-weight: 700; font-size: .82rem; line-height: 1; }
.pl-body { min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.pl-body h3 { font-size: var(--step-0); }
.pl-body h3 em { font-style: normal; color: var(--text-2); font-weight: 500; }
.pl-prog { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pl-prog i { display: block; height: 100%; background: linear-gradient(90deg, rgb(var(--bc)), var(--brand)); }
.pl-meta { font-size: .78rem; color: var(--muted); }
.pl-resume { align-self: flex-start; padding: .6rem 1.1rem; margin-top: .2rem; }
.pl-empty { color: var(--muted); padding: 1.5rem; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; }
.pl-empty a { color: var(--brand); font-weight: 600; }

/* key points */
.kp-wrap { display: flex; flex-direction: column; gap: 1.4rem; }
.kp-group h4 { font-size: var(--step-0); margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }
.kp-group h4 em { font-style: normal; color: var(--text-2); font-weight: 500; }
.kp-group h4 span { margin-left: auto; font-size: .72rem; color: var(--muted); background: var(--glass-2); padding: .1rem .5rem; border-radius: 99px; }
.kp-row { display: flex; align-items: stretch; gap: .4rem; margin-bottom: .5rem; }
.kp-jump { flex: 1; display: flex; align-items: center; gap: .6rem; text-align: left; padding: .7rem .85rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: .2s; min-width: 0; }
.kp-jump:hover { border-color: var(--brand); }
.kp-kind { font-size: .9rem; flex: 0 0 auto; }
.kp-text { flex: 1; font-size: var(--step--1); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-pg { font-size: .72rem; color: var(--muted); flex: 0 0 auto; }
.kp-del { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 10px; width: 38px; cursor: pointer; transition: .2s; }
.kp-del:hover { color: var(--brand); border-color: var(--brand); }

@media (max-width: 900px){
  .profile-grid { grid-template-columns: 1fr; }
  .profile-head { grid-template-columns: auto 1fr; }
  .ph-stats { grid-column: 1 / -1; justify-content: space-around; border-top: 1px solid var(--line); padding-top: 1rem; }
  .ph-out { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 480px){
  .profile-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .ph-nameline { justify-content: center; }
}
