:root {
  --bg:#0b1016; --surface:#111826; --text:#e6edf3; --muted:#9db2c6;
  --brand:#6ee7ff; --brand-2:#a78bfa;
  --radius:16px; --pad:18px; --max:1120px;
  --shadow:0 6px 30px rgba(0,0,0,.25);
  /* NEW: baseline + line color for nav */
  --baseline:2px;
  --line: color-mix(in srgb, var(--muted) 25%, transparent);
}
@media (prefers-color-scheme: light) {
  :root { --bg:#f8fafc; --surface:#ffffff; --text:#0b1220; --muted:#475569; --brand:#0369a1; --brand-2:#7c3aed; --line: color-mix(in srgb, var(--muted) 30%, transparent); }
}

/* Base */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  font:16px/1.6 Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);

  /* Shimmering black ↔ dark purple */
  background: linear-gradient(-45deg, #000000, #0b0014, #1a0026, #000000);
  background-size: 400% 400%;
  animation: shimmerBg 18s ease infinite;
}
@keyframes shimmerBg{
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce){
  body{ animation: none; }
}

a{ color:inherit; text-decoration:none }
img{ max-width:100%; display:block }
.container{ width:min(100%, var(--max)); margin:auto; padding:0 20px }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 2px solid var(--line); /* baseline */
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;   /* tabs align bottom */
  height: 60px;            /* nav height */
  padding: 0;
}

.tabbar {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: flex-end;
}

.tab {
  position: relative;
  padding: 12px 16px;
  border-radius: 12px 12px 0 0;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  border-bottom: none;
  color: var(--text);
  font-weight: 600;
  line-height: 1;
}


.tab:is(:hover, :focus) {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.tab.is-active {
  background: linear-gradient(45deg, var(--brand), var(--brand-2));
  color: #0b1220;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    0 6px 18px rgba(0,0,0,.25);
}

/* Brand overrides */
.brand {
  display: flex;
  align-items: center;     /* keeps logo + text aligned */
  margin-bottom:auto ;    /* pushes brand upward */
  transform: translateY(22px); /* fine-tune upward shift */
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.3px; text-transform:uppercase }
.brand-text{ font-family:"Press Start 2P", system-ui; font-size:12px }
.pixel{
  width:14px; height:14px; image-rendering:pixelated;
  background:linear-gradient(45deg,var(--brand),var(--brand-2));
  box-shadow:0 0 12px color-mix(in srgb, var(--brand) 40%, var(--brand-2) 40%);
}


/* Background greebles (layered behind content) */
.bg-grid{
  position:fixed; inset:0; pointer-events:none; opacity:.08; z-index:-2;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--muted) 18%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--muted) 18%, transparent) 1px, transparent 1px);
  background-size:24px 24px;
}
.bg-sparkles{
  position:fixed; inset:0; pointer-events:none; mix-blend-mode:screen; opacity:.25; z-index:-1;
  background-image:
    radial-gradient(2px 2px at 20% 30%, var(--brand), transparent 60%),
    radial-gradient(2px 2px at 80% 40%, var(--brand-2), transparent 60%),
    radial-gradient(2px 2px at 60% 80%, var(--brand), transparent 60%);
  animation: twinkle 6s linear infinite;
}
@keyframes twinkle{ 0%,100%{ opacity:.15 } 50%{ opacity:.35 } }

/* Sections */
.section{ display:none; padding:56px 0 }
.section.is-active{ display:block }
.section-head h2{ font-family:"Press Start 2P", system-ui; font-size:18px; margin:0 0 8px }
.meta{ color:var(--muted); font-size:14px }

/* Hero */
.hero-grid{ display:grid; grid-template-columns:1.2fr .8fr; gap:28px; padding:56px 0 12px }
.kicker{ color:var(--muted); text-transform:uppercase; letter-spacing:.18em; font-size:12px }
h1{ font-size:clamp(28px, 4vw, 46px); line-height:1.15; margin:.35em 0 .5em }
.name{ background:linear-gradient(45deg,var(--brand),var(--brand-2)); -webkit-background-clip:text; background-clip:text; color:transparent }
.lead{ color:var(--muted) }
.cta{ display:flex; gap:12px; margin:18px 0 }
.btn{
  display:inline-flex; align-items:center; gap:10px; padding:10px 14px; border-radius:12px;
  font-weight:800; border:1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  cursor:pointer; text-decoration:none;
}
.btn-primary{ background:linear-gradient(45deg,var(--brand),var(--brand-2)); color:#0b1220; box-shadow:var(--shadow) }
.btn-ghost{ background:color-mix(in srgb, var(--surface) 70%, transparent); color:var(--text) }

/* Cards */
.card-grid{ display:grid; grid-template-columns: repeat(12, 1fr); gap:18px }
.card{
  grid-column: span 4; background:var(--surface);
  border:1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
  color:inherit; transition: transform .15s ease;
}
.card:hover{ transform: translateY(-4px) }
.card > img{
  width:100%;
  height:clamp(140px, 22vw, 220px);
  object-fit:cover;
  aspect-ratio:auto;
  background:#000;
  display:block;
}

.card img{
  width:100%;
  height:clamp(140px, 22vw, 220px);
  object-fit:cover;
  aspect-ratio:auto;
  background:#000;
  display:block;
}
.card-body{ padding:var(--pad) }
.card-body h3{ margin:0 0 6px; font-size:18px }

/* About grid */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 16px;
}
.about-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}
.about-card:nth-child(1),
.about-card:nth-child(2) { grid-column: span 6; }
.about-skills { grid-column: span 12; }

/* Credential cards */
.cred-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 16px; }
.cred {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.cred-logo {
  width: 64px; height: 64px; border-radius: 12px; background: var(--surface);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 22%, transparent);
}
.cred-logo img { max-width: 70%; max-height: 70%; object-fit: contain; display: block; }
.cred-title { margin: 0 0 4px; font-size: 16px; }
.cred-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.badge-verified { color: #7ee787; border-color: color-mix(in srgb, #7ee787 60%, transparent); }
.cred-bullets { margin: 8px 0 0; padding-left: 18px; color: var(--text); }
.cred-bullets li { margin: 6px 0; }
.cred-actions { margin-top: 10px; display: flex; gap: 8px; }

/* See more credentials (disclosure) */
.cred-details { margin-top: 12px; }
.cred-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-weight: 700;
}
.cred-details > summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}
.cred-details > summary::-webkit-details-marker { display: none; }
.cred-details .expand { display: inline; }
.cred-details[open] .expand { display: none; }
.cred-details .collapse { display: none !important; }
.cred-details .collapsible { overflow: hidden; height: 0; }
.cred-details .show-less {
  display: none;
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}
.cred-details[open] .show-less { display: inline-flex; }

/* Skills */
.about-skills .pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.skill-pill {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); /* keep only outer border */
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: var(--shadow);
}

.icon-frame {
  width: 84px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  /* ✨ removed inner border + inset shadow */
  box-shadow: none;
  border: none;
}

.icon-frame.bigger img {
  width: 150%;
  height: 150%;
}
.icon-frame.smaller img {
  width: 60%;
  height: 60%;
}
.icon-frame img { width: 70%; height: 70%; object-fit: contain; display: block; }
.skill-pill .label { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Contact */
form .grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px }
label{ font-size:14px; color:var(--muted) }
input, textarea{
  width:100%; border:1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background:transparent; color:var(--text); border-radius:12px; padding:12px; font:inherit;
}
textarea{ min-height:120px }
.span-2{ grid-column:1 / span 2 }

/* =======================
   ASCII Pet (compact box)
======================= */
.ascii-pet{
  display: inline-grid;
  grid-template-columns: auto max-content;
  grid-auto-rows: min-content;
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
  margin-top: 16px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: 0 0 0 3px #fff, var(--shadow);
  inline-size: fit-content;
  max-inline-size: min(100%, 520px);
  margin-inline: auto;
}
.ascii-pet pre{
  grid-column: 1;
  grid-row: 1 / span 2;
  margin: 0;
  font:700 14px/16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing:.5px; white-space:pre; color:var(--text);
  text-shadow:0 0 6px color-mix(in srgb, var(--brand) 30%, transparent)
}
.ascii-pet .pet-say,
.ascii-pet .pet-toggle,
.ascii-pet #petToggle{
  grid-column: 2;
  justify-self: start;
  align-self: start;
  padding: 10px 14px;
  line-height: 1;
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
}
.ascii-pet .pet-toggle,
.ascii-pet #petToggle{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

/* Free-roam mode */
.ascii-pet.pet-free {
  position: fixed; left: 0; top: 0; margin: 0; z-index: 1000;
  cursor: none; user-select: none; touch-action: none;
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  animation: none !important;
}
.ascii-pet.pet-free pre { pointer-events: none; }
.ascii-pet.pet-free .pet-say,
.ascii-pet.pet-free #petToggle,
.ascii-pet.pet-free .pet-toggle { display: none !important; }

/* Dock button */
.pet-toggle-fixed{
  position: fixed; right: 16px; bottom: 16px; z-index: 1100;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px; font-weight: 800;
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
@media (max-width:640px){
  .pet-toggle-fixed{ right:12px; bottom:12px; padding:8px 12px; }
}

/* Footer */
footer{ border-top:1px solid color-mix(in srgb, var(--muted) 25%, transparent); padding:24px 0 56px; color:var(--muted) }
.foot{ display:flex; justify-content:space-between; align-items:center }
.top{ text-decoration:none }

/* Hero avatar */
.hero-card{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  max-width:300px; margin:auto;
}
.hero-card img{
  width:260px; height:260px; object-fit:cover;
  border-radius:50%;
  box-shadow:0 0 0 3px #fff, 0 0 12px rgba(255,255,255,.3);
  background:var(--surface);
}
@media (max-width:640px){
  .hero-card img{ width:200px; height:200px; }
}

/* Floating dandelion seeds */
.dandelion-bg{
  position:fixed; inset:0; pointer-events:none; overflow:hidden; z-index:0;
}
.dandelion-seed{
  position:absolute;
  width:18px; height:18px;
  background:url('assets/dandeion.png') no-repeat center/contain;
  opacity:.28;
  top:-10vh;
  left:var(--x, 0vw);
  animation: fallSeed var(--dur, 18s) linear var(--delay, 0s) infinite;
  will-change: transform, opacity;
}
@keyframes fallSeed{
  0%   { transform: translateY(-15vh) translateX(0) rotate(0deg); opacity:0; }
  10%  { opacity:.34; }
  50%  { transform: translateY(55vh) translateX(var(--dx, 40px)) rotate(120deg); }
  90%  { opacity:.34; }
  100% { transform: translateY(115vh) translateX(calc(var(--dx, 40px) * 1.3)) rotate(240deg); opacity:0; }
}
@media (prefers-reduced-motion: reduce){
  .dandelion-seed{ animation:none; display:none; }
}

/* ===== Fix: avoid height cuts ===== */
.about-grid { align-items: start; }
.about-grid > .about-card { align-self: start; }
.about-skills h3 { margin: 0 0 10px; }
.about-skills .pills { margin: 10px 0 0; }
.about-skills .pills:last-child,
.about-skills > *:last-child { margin-bottom: 0 !important; }
.about-skills { padding-bottom: calc(var(--pad) - 6px); }

/* Responsive */
@media (max-width:900px){
  .hero-grid{ grid-template-columns:1fr }
  .hero-card{ justify-self:start; order:-1 }
  .card{ grid-column: span 6 }
  .about-card:nth-child(1),
  .about-card:nth-child(2),
  .about-skills { grid-column: span 12; }
}
@media (max-width:640px){
  .tabbar{ gap:6px }
  .tab{ padding:8px 10px }
  .card{ grid-column: span 12 }
  form .grid{ grid-template-columns:1fr }
  .span-2{ grid-column:auto }
  .ascii-pet{
    display: grid;
    inline-size: 100%;
    max-inline-size: 100%;
  }
  .ascii-pet pre{ font-size:12px; line-height:14px }
  .about-skills .pills { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
  .icon-frame { width: 76px; }
  .cred { grid-template-columns: 48px 1fr; }
  .cred-logo { width: 48px; height: 48px; }
}

/* Motion prefs */
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important }
}

.scroll-site .section{
  display:block;
  scroll-margin-top:80px;
  padding:72px 0;
}
@media (min-width:640px){
  .nav { background: color-mix(in srgb, var(--bg) 90%, transparent); }
}

.card-body .gallery-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  margin: 16px 0 10px;
  color: var(--muted);
}

/* In-card gallery (2×2) */
.card-body .gallery{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 per row */
  gap: 14px;
  margin-top: 12px;
}

/* Thumbnails */
.card-body .g-thumb{
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;            /* square tiles */
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 0 !important;    /* no rounded corners */
  background: rgba(255,255,255,.04);
  cursor: zoom-in;
}
.card-body .g-thumb img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1); transition: transform .25s ease, filter .25s ease;
}
.card-body .g-thumb:hover img{ transform: scale(1.08); filter: brightness(1.05); }

/* Optional label */
.card-body .g-thumb::after{
  content:"View"; position:absolute; right:8px; bottom:8px;
  font-size:11px; padding:4px 8px; border-radius:8px;
  background:rgba(0,0,0,.45); color:#fff;
  opacity:0; transform:translateY(4px); transition:.2s;
}
.card-body .g-thumb:hover::after{ opacity:1; transform:none; }

/* Keep 2×2 even on small screens (change to 1fr if you want 1-per-row on phones) */
@media (max-width: 620px){
  .card-body .gallery{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 999;
}
.lightbox:target { opacity: 1; pointer-events: auto; }

/* Image scales up responsively */
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  animation: zoomIn .35s ease;
}

/* Optional: fade/zoom animation */
@keyframes zoomIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Caption styling */
.lightbox figcaption {
  margin-top: 12px;
  text-align: center;
  color: #e6edf3;
  font-size: 15px;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  text-decoration: none; font-weight: 800; line-height: 1;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
  padding: 10px 12px; border-radius: 10px; color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close {
  top: 18px; right: 18px; transform: none;
  font-size: 14px; padding: 8px 10px; border-radius: 999px; cursor: pointer;
}
.lb-prev:hover, .lb-next:hover, .lb-close:hover { background: rgba(255,255,255,.18); }

/* Contact layout */
.contact-grid{
  display:grid;
  grid-template-columns: .8fr 1.2fr;
  gap:18px;
  margin-top:16px;
}
@media (max-width:900px){
  .contact-grid{ grid-template-columns:1fr; }
}

/* Social card + list */
.social-card{
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}

.socials{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:12px;
  margin-top:12px;
}
.btn-social{
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; border-radius:12px; font-weight:800;
  border:1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.btn-social svg{ width:18px; height:18px; flex:0 0 18px; }
