:root{
  --bg:#0f1115;
  --panel:#141824;
  --text:#e9ecf1;
  --muted:#b8c0d4;
  --line:rgba(233,236,241,.12);
  --accent:#9be7ff;
  --accent2:#ffd38a;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --max: 1060px;
  --gap: 16px;
  --font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, 'Apple Color Emoji','Segoe UI Emoji';
  --font-display: 'Space Grotesk', var(--font-sans);
  /* Brand gradient (from the top-left mark) */
  --brand-start: rgba(155,231,255,.95);
  --brand-end: rgba(255,211,138,.85);
  --brand-start-soft: rgba(155,231,255,.14);
  --brand-end-soft: rgba(255,211,138,.12);
  --brand-grad: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  --brand-grad-soft: linear-gradient(135deg, var(--brand-start-soft), var(--brand-end-soft));
  /* Site overlay gradient using the brand colors (subtle) */
  --site-gradient: var(--brand-grad-soft);
}

html{height:100%; scroll-behavior:smooth}
*{box-sizing:border-box}
body{
  height:100%;
  margin:0;
  background:
    var(--site-gradient),
    radial-gradient(900px 600px at 20% -10%, rgba(155,231,255,.12), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(255,211,138,.10), transparent 60%),
    radial-gradient(900px 600px at 60% 110%, rgba(155,231,255,.08), transparent 60%),
    var(--bg);
  color:var(--text);
  font-size:16px; line-height:1.6; font-family: var(--font-sans);
  letter-spacing: .2px;
}

::selection{background:rgba(155,231,255,.25)}

a{color:inherit; text-decoration:none}
a:hover{opacity:.92}

.wrap{max-width:none; width:100%; margin:0; padding:28px clamp(16px, 4vw, 48px) 80px}

/* Top strip */
.top{display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:22px}
.brand{display:flex; align-items:center; gap:12px}
.mark{
  width:38px; height:38px; border-radius:12px;
  background: var(--brand-grad);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  position:relative; overflow:hidden;
}
.mark:after{
  content:""; position:absolute; inset:-40% -40% auto auto; width:120%; height:120%;
  transform: rotate(18deg);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 58%);
  opacity:.55;
}
.brand strong{display:block; font-weight:700; letter-spacing:.4px; font-size: clamp(20px, 2.6vw, 28px)}
.brand span{display:block; color:var(--muted); font-size:13px; margin-top:-2px}

/* Headings use display font */
h1, h2, h3, .summary__title, .hero__titles h1, .brand strong{ font-family: var(--font-display); }

.nav{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.chip{
  text-decoration:none;
  border:1px solid var(--line);
  padding:8px 10px;
  border-radius:999px;
  color:var(--muted);
  background: var(--brand-grad-soft), rgba(255,255,255,.02);
}
.chip:hover{border-color:rgba(155,231,255,.35); color:var(--text)}
button.chip{appearance:none; cursor:pointer; font: inherit}

/* Icon button + icons */
.icon-btn{display:inline-flex; align-items:center; justify-content:center; gap:6px}
.icon{width:18px; height:18px; display:inline-block}
.icon-sun{display:none}
.icon-moon{display:inline-block}
html[data-theme="light"] .icon-sun{display:inline-block}
html[data-theme="light"] .icon-moon{display:none}

/* Visually hidden for a11y */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Buttons */
.actions{display:flex; gap:10px; flex-wrap:wrap; margin:14px 0 0}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 14px; border-radius:12px; border:0;
  background: var(--brand-grad);
  color:#0a0d12; font-weight:600; text-decoration:none;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.btn:hover{filter:saturate(1.05)}
.btn:focus-visible{outline:2px solid var(--accent)}
.btn.btn--ghost{
  background:transparent; color:var(--text); border:1px solid var(--line);
}

/* Hero */
.hero{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-radius: calc(var(--radius) + 6px);
  padding:22px; box-shadow: var(--shadow);
  margin-bottom: 28px;
  position:relative; overflow:hidden;
}
.hero--with-bg{
  min-height: clamp(280px, 42vh, 520px);
  padding: clamp(20px, 3vw, 36px);
  display: grid;
  align-content: end;
}
.hero__bg{
  position:absolute; inset:0; z-index:0;
  background:
    linear-gradient(180deg, rgba(10,13,18,.45), rgba(10,13,18,.65)),
    var(--hero-bg, radial-gradient(900px 600px at 20% -10%, rgba(155,231,255,.12), transparent 60%));
  background-size:cover; background-position:center; filter:saturate(1.02);
  pointer-events:none;
}
.hero__content{position:relative; z-index:1}
.hero__profile{display:flex; align-items:center; gap:12px; margin-bottom:6px}
.avatar{width:96px; height:96px; border-radius:50%; object-fit:cover; border:2px solid var(--line); box-shadow:0 8px 18px rgba(0,0,0,.35); background:rgba(255,255,255,.04)}
.hero__titles h1{
  margin:0 0 2px; font-size: clamp(24px, 5vw, 34px); line-height:1.2;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip:text; color:transparent;
}
.subtitle{margin:0; color:var(--muted)}
.lead{margin:6px 0 0; color:var(--muted)}

/* Ensure sections start below hero */
.hero + section{ margin-top: 12px; }

/* Sections */
section{margin-top:28px}
section>header{display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:10px 0 12px}
section>header h2{margin:0; font-size:20px}
section>header p{margin:0; color:var(--muted)}

/* Cards */
.card{
  border:1px solid var(--line);
  background: var(--brand-grad-soft), linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-radius: var(--radius); padding:16px; box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.card:hover{border-color:rgba(155,231,255,.25)}
.note{color:var(--muted)}

/* Summary section */
.summary{margin: 20px 0 24px}
.summary__layout{display:grid; grid-template-columns:1fr; gap:16px; align-items:center}
.summary .avatar{width:112px; height:112px}
.summary__title{
  margin:0 0 2px; font-size: clamp(22px, 4.5vw, 30px); line-height:1.2;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip:text; color:transparent;
}
@media (max-width:720px){
  .summary__layout{grid-template-columns:1fr}
  .summary .avatar{width:72px; height:72px}
}

/* Tags */
.tags{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.tag{
  display:inline-flex; align-items:center; gap:6px; padding:6px 10px;
  border:1px solid var(--line); border-radius:999px; font-size:13px; color:var(--text);
  background: var(--brand-grad-soft);
}

/* Projects grid */
.grid{display:grid; gap:16px}
.cards{grid-template-columns: repeat(auto-fill, minmax(320px, 1fr))}
.cards > .project--wide{ grid-column: 1 / -1; }
.twoCols{display:grid; gap:16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr))}
.project__header{display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 6px}
.project__actions{display:flex; gap:8px}

/* Embeds */
.embed{margin-top:12px}
.embed__frame{position:relative; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#0b0f15}
.embed__frame{aspect-ratio:16/9}
.embed__frame iframe{position:absolute; inset:0; width:100%; height:100%; border:0; filter:saturate(1.02)}
.embed__fallback{margin-top:10px; padding:12px; text-align:center; border:1px dashed var(--line); border-radius:12px}
.embed__fallback[hidden]{display:none!important}

/* Screenshot gallery */
.gallery{display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top:12px}
.gallery__item{border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--panel); box-shadow:0 2px 8px rgba(0,0,0,.12)}
.gallery__item img{display:block; width:100%; aspect-ratio:16/9; object-fit:cover; filter:saturate(1.02)}
.gallery__item figcaption{padding:10px 12px; color:var(--muted); font-size:14px}

/* Horizontal scrolling gallery for Project One */
.gallery--horizontal{display:flex; gap:12px; overflow-x:auto; padding-bottom:8px; scroll-snap-type:x mandatory}
.gallery--horizontal .gallery__item{flex:0 0 auto; min-width: clamp(420px, 60vw, 880px); scroll-snap-align:start}
.gallery--horizontal .gallery__item img{aspect-ratio:21/9}
@media (max-width:720px){
  .gallery--horizontal .gallery__item{min-width: 320px}
}

/* Footer */
footer{margin-top:36px; color:var(--muted); font-size:14px; display:grid; gap:8px; justify-items:center; text-align:center}
.hint{opacity:.9}

/* Focus styles */
a:focus-visible, button:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:10px}

/* Light theme */
html[data-theme="light"]{
  --bg:#f7f9fc;
  --panel:#ffffff;
  --text:#10131a;
  --muted:#4b5568;
  --line:rgba(0,0,0,.12);
  --accent:#9be7ff;
  --accent2:#ffd38a;
  /* Slightly lighter overlay in light mode */
  --brand-start-soft: rgba(155,231,255,.10);
  --brand-end-soft: rgba(255,211,138,.08);
  --site-gradient: var(--brand-grad-soft);
}
html[data-theme="light"] body{
  background:
    var(--site-gradient),
    radial-gradient(900px 600px at 20% -10%, rgba(155,231,255,.10), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(255,211,138,.10), transparent 60%),
    var(--bg);
}

/* Media */
@media (max-width:720px){
  .top{gap:10px}
  .brand strong{font-size:15px}
  .brand span{font-size:12px}
  .btn{padding:9px 12px}
  .hero--with-bg{min-height: 320px}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{transition:none!important}
}
