/* ================= THEME ================= */
:root {
  --bg: #f7f3ec;
  --bg-2: #efe9df;
  --text: #14213d;
  --muted: #5b6477;
  --accent: #f26b1d;
  --accent-soft: rgba(242, 107, 29, 0.12);
  --card: #ffffff;
  --border: rgba(20, 33, 61, 0.08);
  --shadow: 0 1px 2px rgba(20, 33, 61, 0.04), 0 10px 30px rgba(20, 33, 61, 0.07);
  --shadow-hover: 0 2px 4px rgba(20, 33, 61, 0.05), 0 18px 40px rgba(20, 33, 61, 0.12);
  --radius: 22px;
  --radius-sm: 12px;
  --sidebar-w: 260px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --green: #16a34a;
  --amber: #d97706;
  --gray: #6b7280;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0c0d10;
  --bg-2: #15171c;
  --text: #eceef2;
  --muted: #9aa1ad;
  --accent-soft: rgba(242, 107, 29, 0.16);
  --card: #16181d;
  --border: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.5);
  --green: #4ade80;
  --amber: #fbbf24;
  --gray: #9ca3af;
  color-scheme: dark;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ================= BASE ================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; overflow-x: clip; }
body {
  overflow-x: clip;
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
svg { flex-shrink: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ================= SIDEBAR ================= */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 24px 20px 18px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), background 0.3s;
}
/* Scrollbar stays hidden until the sidebar is hovered, then shows as a thin faint bar */
.sidebar { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar:hover { scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 18%, transparent); }
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; }
.photo {
  position: relative;
  width: 150px; height: 150px;
  margin-bottom: 10px;
}
.photo::before {
  content: "";
  position: absolute; inset: 14% 8% 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%);
  filter: blur(18px);
}
.photo img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(#000 72%, transparent);
  -webkit-mask-image: linear-gradient(#000 72%, transparent);
}
.name-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.name { font-size: 1.2rem; font-weight: 700; }
.verified {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
}
.handle { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.creds { font-size: 0.68rem; color: var(--text); opacity: 0.75; }
.role { font-size: 0.74rem; color: var(--accent); margin-top: 6px; min-height: 1.3em; white-space: nowrap; }

.social-row {
  display: flex; justify-content: center; gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.social-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s, border-color 0.2s;
}
.social-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.caret { animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

.dock-item svg, .nav-link svg, .social-btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500; font-size: 0.93rem;
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover { color: var(--text); background: color-mix(in srgb, var(--card) 60%, transparent); }
.nav-link.active { color: var(--text); font-weight: 600; background: var(--card); box-shadow: var(--shadow); }
.nav-link.active svg { color: var(--accent); }
.sidebar-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.66rem; line-height: 1.5; color: var(--muted);
}
.foot-badge {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.8rem;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 12%, transparent);
}

/* ================= MOBILE DRAWER ================= */
.hamburger {
  display: none;
  position: fixed; top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 70;
  cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.hamburger span {
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 40;
}

/* ================= CTA PILL ================= */
.cta-pill {
  position: fixed; top: 20px; right: 28px;
  z-index: 30;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--shadow);
  display: inline-flex; gap: 8px; align-items: center;
  transition: background 0.2s, transform 0.2s ease-out;
}
.cta-pill:hover { background: var(--accent); color: #fff; }

/* ================= MAIN ================= */
.main {
  margin-left: var(--sidebar-w);
  padding: 72px clamp(20px, 4vw, 56px) 120px;
  max-width: calc(1240px + var(--sidebar-w));
}
.section { padding-top: 96px; }
.section-head { margin-bottom: 32px; max-width: 760px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 8px 0 10px; }

/* ================= HERO ================= */
.hero { position: relative; padding: 24px 0 40px; max-width: 860px; }
.hero-deco {
  position: absolute;
  inset: -20px -10% auto -4%;
  width: 115%; height: 300px;
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
  z-index: -1;
}
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 700; letter-spacing: -0.035em; }
.subtext { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--muted); margin-top: 20px; max-width: 640px; }

/* ================= TOOLKIT ================= */
.toolkit {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 12px 12px 22px;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--text) 4%, var(--bg));
  border: 1px solid var(--border);
}
.toolkit-label { display: flex; flex-direction: column; flex-shrink: 0; padding-right: 20px; border-right: 1px solid var(--border); }
.toolkit-label strong { font-size: 1.05rem; }
.toolkit-strip {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.toolkit-strip::-webkit-scrollbar { display: none; }
.tool {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 2px 18px;
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap;
}
.tool + .tool { border-left: 1px solid var(--border); }
.tool i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }

/* ================= DASHBOARD ================= */
.dash {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  border-radius: calc(var(--radius) + 10px);
  background: color-mix(in srgb, var(--text) 4%, var(--bg));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--card) 70%, transparent);
}
.dash-card {
  position: relative;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
  min-height: 270px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease-out, box-shadow 0.25s, border-color 0.25s;
}
.dash-card:hover { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.dash-card.span-2 { grid-column: span 2; }
.dash-card.span-2:first-child { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); align-items: start; }
.dash-card.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); }
.dash-head { display: flex; flex-direction: column; gap: 10px; }
.dash-head > div { display: flex; flex-direction: column; gap: 6px; }
.dash-card h3 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.dash-card .dash-head p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.dash-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #f26b1d, #f59e0b);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.dash-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.go {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.contact-card:hover .go { background: var(--accent); color: #fff; transform: rotate(45deg); }

/* Systems preview carousel */
.preview { display: flex; flex-direction: column; gap: 10px; }
.preview-window {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.browser-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem; color: var(--muted);
}
.browser-bar i, .term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.browser-bar i:nth-child(2), .term-bar i:nth-child(2) { background: #febc2e; }
.browser-bar i:nth-child(3), .term-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { margin-left: 8px; }
.slides { display: grid; }
.slide {
  grid-area: 1 / 1;
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.5s, transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.slide.is-active { opacity: 1; transform: none; }
.bars { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bars span { height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), transparent); opacity: 0.6; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.rows li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--card);
  font-family: var(--mono); font-size: 0.7rem;
}
.rows li span { margin-left: auto; color: var(--muted); }
.rows i { width: 7px; height: 7px; border-radius: 50%; }
.rows i.ok { background: var(--green); }
.rows i.warn { background: var(--amber); }
.slide-dots { display: flex; justify-content: center; gap: 6px; }
.slide-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--border); transition: width 0.3s, background 0.3s; }
.slide-dots i.on { width: 18px; background: var(--accent); }

/* About: stacked photo cards */
.photo-stack { position: relative; flex: 1; min-height: 140px; margin-top: auto; }
.photo-stack span {
  position: absolute; bottom: 0; left: 50%;
  width: 118px; height: 138px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.photo-stack span:nth-child(1) { transform: translateX(-85%) rotate(-10deg); background: var(--bg); }
.photo-stack span:nth-child(2) { transform: translateX(-60%) rotate(-4deg); }
.photo-stack .front {
  transform: translateX(-35%) rotate(5deg);
  overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--card)), var(--card));
}
.photo-stack .front img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.dash-card:hover .photo-stack span:nth-child(1) { transform: translateX(-100%) rotate(-14deg); }
.dash-card:hover .photo-stack .front { transform: translateX(-30%) rotate(8deg) translateY(-6px); }

/* Toolbox: two scrolling pill rows */
.pill-rows { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.pill-marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.pill-track { display: flex; gap: 8px; width: max-content; animation: pill-scroll 22s linear infinite; }
.pill-marquee.reverse .pill-track { animation-direction: reverse; animation-duration: 26s; }
.dash-card:hover .pill-track { animation-play-state: paused; }
@keyframes pill-scroll { to { transform: translateX(calc(-50% - 4px)); } }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.76rem; font-weight: 600;
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Credentials: medal */
.medal-wrap { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.medal {
  width: 104px; height: 104px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 0 0 8px var(--bg);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.medal svg { width: 56px; height: 56px; }
.dash-card:hover .medal { transform: rotate(-8deg) scale(1.05); }
.medal-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: 0.72rem; font-weight: 600;
}
.medal-pill i { width: 7px; height: 7px; border-radius: 50%; background: #3b82f6; }

/* Services list */
.svc-list { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; }
.svc-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px;
  font-size: 0.86rem; font-weight: 600;
}
.svc-list li + li { border-top: 1px solid var(--border); }
.svc-list i {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--accent-soft);
  position: relative;
  flex-shrink: 0;
}
.svc-list i::after { content: ""; position: absolute; inset: 7px; border-radius: 2px; background: var(--accent); opacity: 0.7; }
.svc-list .mono { margin-left: auto; font-size: 0.68rem; color: var(--muted); font-weight: 400; }
.svc-list li.more { font-size: 0.76rem; font-weight: 500; color: var(--muted); }
.svc-list li.more .mono { color: var(--accent); font-weight: 600; }

/* Testimonials: vertical auto-scroll */
.t-scroll {
  position: relative;
  align-self: stretch;
  min-height: 230px;
  overflow: hidden;
  mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
}
.t-track { position: absolute; inset: 0 0 auto; display: flex; flex-direction: column; gap: 10px; animation: t-scroll 16s linear infinite; }
.dash-card:hover .t-track { animation-play-state: paused; }
@keyframes t-scroll { to { transform: translateY(calc(-50% - 5px)); } }
.t-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
}
.t-card span { font-size: 0.75rem; color: var(--muted); }
.t-card em { font-style: normal; font-size: 0.72rem; font-weight: 600; color: var(--accent); margin-top: 2px; }

.tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ================= PROJECTS ================= */
.project { padding: 26px; display: flex; flex-direction: column; gap: 14px; transition: transform 0.25s ease-out, box-shadow 0.25s; }
.project:hover { box-shadow: var(--shadow-hover); }
.project-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.project h3 { font-size: 1.25rem; }
.project p { color: var(--muted); }
.featured { margin-bottom: 18px; padding: 34px; }
.featured h3 { font-size: 1.7rem; }
.featured p { font-size: 1.05rem; max-width: 680px; }
.tag-featured {
  align-self: flex-start;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
.status {
  font-family: var(--mono);
  font-size: 0.7rem; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.prod { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.status.wip { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.status.archived { color: var(--gray); background: color-mix(in srgb, var(--gray) 14%, transparent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.links { display: flex; gap: 20px; margin-top: auto; }
.arrow-link { font-weight: 600; font-size: 0.9rem; color: var(--accent); display: inline-flex; gap: 6px; }
.arrow-link span { transition: transform 0.2s; }
.arrow-link:hover span { transform: translateX(4px); }
.footer .arrow-link:hover span { transform: translateY(-3px); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* Animated gradient ring */
.glow-border {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.glow-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), transparent 0deg, var(--accent) 60deg, #f59e0b 120deg, transparent 180deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: rotate-angle 5s linear infinite;
  pointer-events: none;
}
@keyframes rotate-angle { to { --angle: 360deg; } }

/* ================= CREDENTIALS ================= */
.cert-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.cert { padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: transform 0.25s ease-out, box-shadow 0.25s; }
.cert:hover { box-shadow: var(--shadow-hover); }
.cert-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.cert h3 { font-size: 1.02rem; }
.cert p { font-size: 0.86rem; }
.cert-area { margin-top: auto; padding-top: 10px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.featured-cert { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

/* ================= SERVICES ================= */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.service { padding: 26px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.25s, box-shadow 0.25s; }
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.service .num { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.service h3 { font-size: 1.15rem; }

/* ================= TOOLBOX ================= */
.marquee {
  overflow: hidden;
  padding: 18px 0;
  margin-bottom: 24px;
  border-block: 1px solid var(--border);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex; gap: 40px;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-size: 1.05rem; font-weight: 500;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 40px; }
.marquee-track span::after { content: "✦"; color: var(--accent); font-size: 0.8rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 20px)); } }
.skills-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.skill { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.skill h3 { font-size: 1.05rem; }

/* ================= TESTIMONIALS ================= */
.quotes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.quote { margin: 0; padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.quote blockquote { margin: 0; font-size: 1.05rem; line-height: 1.55; }
.quote figcaption { display: flex; flex-direction: column; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.quote figcaption .mono { font-size: 0.75rem; }

/* ================= ABOUT ================= */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.about-text > p { color: var(--muted); margin-bottom: 16px; font-size: 1.02rem; }
.timeline { list-style: none; padding: 0 0 0 28px; margin: 28px 0 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--border);
  background: linear-gradient(var(--accent), var(--border));
}
.timeline li { position: relative; display: flex; flex-direction: column; padding-bottom: 22px; }
.timeline li::before {
  content: "";
  position: absolute; left: -27px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
}
.timeline strong { margin-top: 2px; }
.timeline .muted { font-size: 0.9rem; }

.terminal {
  background: #0f1115;
  border-color: rgba(255,255,255,0.06);
  color: #d4d8e0;
  overflow: hidden;
  position: sticky; top: 90px;
}
.term-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: #171a20;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.72rem; color: #7d8594;
}
.term-bar span { margin-left: auto; margin-right: auto; transform: translateX(-20px); }
.term-body {
  margin: 0;
  padding: 18px 20px 22px;
  min-height: 300px;
  font-size: 0.8rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .p { color: #f26b1d; }
.term-body .ok { color: #4ade80; }
.term-body .dim { color: #7d8594; }
.term-body .cursor { display: inline-block; width: 8px; height: 1em; background: #d4d8e0; vertical-align: -2px; animation: blink 1s steps(1) infinite; }

/* ================= CONTACT ================= */
.contact-title { font-size: clamp(2rem, 4.5vw, 3.4rem) !important; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.contact-card {
  position: relative;
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.25s ease-out, box-shadow 0.25s;
}
.contact-card:hover { box-shadow: var(--shadow-hover); }
.contact-card strong { font-size: 1rem; word-break: break-all; padding-right: 36px; }
.contact-card .go { position: absolute; top: 20px; right: 20px; }

/* ================= EFFECTS ================= */
/* Hero background: dot pattern, spotlight, meteors */
.hero-bg {
  position: absolute;
  top: -72px; left: 50%;
  width: 100vw; height: 640px;
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  mask-image: linear-gradient(#000 60%, transparent);
}
.dot-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 22%, transparent) 1px, transparent 1.6px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 55% 60% at 35% 35%, #000 20%, transparent 75%);
}
.spotlight {
  position: absolute;
  top: -180px; left: 8%;
  width: 900px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%);
  filter: blur(50px);
  opacity: 0;
  transform: translate(-20%, -30%) rotate(-24deg) scale(0.6);
  animation: spotlight-in 2.2s 0.2s cubic-bezier(.2,.8,.2,1) forwards;
}
[data-theme="dark"] .spotlight { background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); }
@keyframes spotlight-in { to { opacity: 0.8; transform: translate(0, 0) rotate(-24deg) scale(1); } }
.meteor {
  position: absolute;
  top: -8px; left: var(--x);
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 1px color-mix(in srgb, var(--accent) 60%, transparent);
  opacity: 0;
  transform: rotate(215deg);
  animation: meteor var(--dur) linear var(--delay) infinite;
}
.meteor::before {
  content: "";
  position: absolute; top: 50%;
  width: 90px; height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--accent), transparent);
}
@keyframes meteor {
  0% { opacity: 1; transform: rotate(215deg) translateX(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(215deg) translateX(-700px); }
}

/* Headline: word-by-word blur in, gradient accent word */
.text-generate.js-split .word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px);
  animation: word-in 0.7s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i) * 90ms + 150ms);
}
@keyframes word-in { to { opacity: 1; filter: blur(0); transform: none; } }
.gradient-text {
  background: linear-gradient(90deg, var(--accent), #f59e0b, #ef4444, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: gradient-pan 6s linear infinite;
}
@keyframes gradient-pan { to { background-position: 300% 0; } }
/* Stats with number ticker */
.stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 56px); margin: 32px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .plus { color: var(--accent); }
.stats dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* Cursor spotlight on cards */
.card, .dash-card, .glow-border { isolation: isolate; }
.card::after, .dash-card::after, .glow-border::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s;
}
.card:hover::after, .dash-card:hover::after, .glow-border:hover::after { opacity: 1; }

/* Sliding highlight behind hovered card in a grid */
.hover-group { position: relative; }
.hover-group > :not(.hover-bg) { position: relative; z-index: 1; }
.hover-bg {
  position: absolute; top: 0; left: 0;
  z-index: 0;
  border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, #f59e0b 14%, transparent));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), width 0.35s cubic-bezier(.2,.8,.2,1), height 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.25s;
}
.hover-bg.on { opacity: 1; }

/* Shimmer buttons */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn:not(.ghost)::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }

/* Moving border on the CTA pill */
.cta-pill::before {
  content: "";
  position: absolute; inset: -2px;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), transparent 0deg, transparent 220deg, var(--accent) 290deg, #f59e0b 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: rotate-angle 3s linear infinite;
  pointer-events: none;
}

/* Floating dock (shown when the sidebar is hidden) */
.dock {
  display: none;
  position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 45;
  align-items: flex-end; gap: 8px;
  padding: 8px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dock-item {
  --s: 1;
  position: relative;
  width: calc(42px * var(--s)); height: calc(42px * var(--s));
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: grid; place-items: center;
  padding: 0;
  cursor: pointer;
  transition: width 0.18s ease-out, height 0.18s ease-out, color 0.2s, border-color 0.2s;
}
.dock-item svg { width: calc(18px * var(--s)); height: calc(18px * var(--s)); }
.dock-item:hover, .dock-item:focus-visible { color: var(--accent); border-color: var(--accent); }
.dock-item::after {
  content: attr(data-label);
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translate(-50%, 4px);
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--text); color: var(--bg);
  font-family: var(--mono); font-size: 0.7rem; white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.dock-item:hover::after, .dock-item:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.dock-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--border); }

/* Scroll progress beam along the sidebar edge */
.scroll-beam {
  position: fixed; top: 0; bottom: 0; left: calc(var(--sidebar-w) - 1px);
  width: 2px;
  z-index: 55;
  pointer-events: none;
}
.scroll-beam span {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 0;
  background: linear-gradient(180deg, transparent, var(--accent) 40%, #f59e0b);
  border-radius: 2px;
}
.scroll-beam span::after {
  content: "";
  position: absolute; bottom: -4px; left: 50%;
  width: 8px; height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 12px 3px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ================= FORMS ================= */
[hidden] { display: none !important; }
.form { margin-top: 18px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.form h3 { font-size: 1.15rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.form input, .form textarea, .form select {
  font: inherit; font-size: 0.95rem; font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form textarea { resize: vertical; min-height: 96px; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form [aria-invalid="true"] { border-color: #dc2626; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-status { font-size: 0.85rem; }
.form-status.error { color: #dc2626; }
.form-status.ok { color: var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn {
  font: inherit; font-weight: 600; font-size: 0.9rem;
  padding: 11px 20px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  cursor: pointer;
  transition: filter 0.2s, opacity 0.2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: #dc2626; }

/* ================= LIKES ================= */
.like-btn {
  margin-left: auto;
  align-self: center;
  font: inherit; font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.like-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.like-btn:hover { color: var(--accent); border-color: var(--accent); }
.like-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }

/* ================= GUESTBOOK ================= */
.guestbook-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 18px; align-items: start; }
.guestbook-grid .form { margin-top: 0; }
.guestbook-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.guestbook-list li { padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.guestbook-list .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 0.75rem; }
.guestbook-list p { overflow-wrap: anywhere; white-space: pre-wrap; }

/* ================= ADMIN ================= */
.admin { max-width: 960px; margin: 0 auto; padding: 48px clamp(16px, 4vw, 40px) 80px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 6px; }
.admin-actions { display: flex; gap: 10px; }
.admin-login { max-width: 420px; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); }
.form label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 10px 16px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab .count:not(:empty) { font-size: 0.7rem; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.admin-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.admin-item { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.admin-item.unread { border-left: 3px solid var(--accent); }
.admin-item .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; }
.admin-item .meta .muted.mono { margin-left: auto; font-size: 0.75rem; }
.admin-item p { overflow-wrap: anywhere; white-space: pre-wrap; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.item-actions .btn { padding: 7px 14px; font-size: 0.8rem; }

/* ================= FOOTER ================= */
.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted);
}

/* ================= VISIT COUNTER ================= */
.visit-pill {
  position: fixed; right: 20px; bottom: 20px;
  z-index: 30;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.72rem;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.visit-pill { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 600; }
.visit-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* ================= REVEAL ================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--delay, 0s);
}
.reveal.visible { opacity: 1; transform: none; }
/* once revealed, hover/tilt transforms should respond quickly */
.reveal.visible.tilt, .reveal.visible.dash-card { transition: transform 0.25s ease-out, box-shadow 0.25s, border-color 0.25s, opacity 0.7s; transition-delay: 0s; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-grid, .project-grid, .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-card.span-2:first-child, .dash-card.split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .terminal { position: relative; top: 0; }
  .quotes-grid, .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guestbook-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,0.25); }
  .hamburger { display: flex; }
  .main { margin-left: 0; padding-top: 88px; }
  .cta-pill { right: 72px; top: 16px; padding: 11px 16px; }
  .scroll-beam { left: 0; }
  .dock { display: flex; }
}
@media (max-width: 640px) {
  .dash, .cert-grid, .project-grid, .services-grid, .skills-grid, .quotes-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-card.span-2 { grid-column: auto; }
  .dash-card.span-2:first-child, .dash-card.split { grid-template-columns: minmax(0, 1fr); }
  .dash { padding: 10px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .toolkit { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .toolkit-label { border-right: 0; padding-right: 0; }
  .featured { padding: 24px; }
  .project-top { flex-direction: column; }
  .cta-pill { font-size: 0.82rem; }
  .section { padding-top: 72px; }
  .visit-pill { right: 12px; bottom: 84px; }
  .dock { bottom: 12px; gap: 6px; }
}
@media (max-width: 380px) {
  .cta-pill span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .meteor { display: none; }
  .spotlight { animation: none; opacity: 0.8; transform: rotate(-24deg); }
}
