:root {
  --bg: #f7f7fb; --bg-alt: #eef0f7; --card: #ffffff; --text: #171923; --muted: #5b6275;
  --accent: #ff7a18; --accent-2: #ffb347; --green: #16a34a; --border: #e2e5ef;
  --shadow: 0 8px 24px rgba(23,25,35,.06); --radius: 16px;
  --term: #11131b;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1117; --bg-alt: #151824; --card: #1b1f2d; --text: #eef0f6; --muted: #9aa3b8;
    --border: #2a2f42; --shadow: 0 8px 24px rgba(0,0,0,.35); --green: #4ade80; --term: #0a0c12; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Inter", system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .logo { font-family: "Space Grotesk", "Inter", sans-serif; line-height: 1.15; }
.mono, pre, .tags span, .meta, .status, .draft { font-family: "JetBrains Mono", ui-monospace, monospace; }
a { color: inherit; text-decoration: none; }
.container { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.35rem; font-weight: 700; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 1.5rem; }
.nav nav a { color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 6rem 0 5rem;
  background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%),
              radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 40%); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 700; letter-spacing: -.02em; }
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 42ch; margin: 1.25rem 0 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: .85rem 1.5rem; border-radius: 999px; font-weight: 600; transition: transform .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1205; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { border: 1.5px solid var(--border); background: var(--card); }

.terminal { background: var(--term); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); overflow: hidden; border: 1px solid #262a3a; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: .6rem .9rem; background: #1a1d29; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: .6rem; color: #8a90a6; font: 500 .8rem "JetBrains Mono", monospace; }
.terminal pre { color: #d7dbe8; padding: 1.2rem 1.4rem; font-size: .9rem; line-height: 1.75; overflow-x: auto; }
.terminal .p { color: var(--accent); } .terminal .c { color: #8a90a6; } .terminal .o { color: var(--accent-2); }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
.section { padding: 5rem 0; }
.section.alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 2rem; display: inline-block; }
.section h2::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 4px; margin-top: .6rem; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.section h2.noline { margin-bottom: .5rem; } .section h2.noline::after { display: none; }
.lead { color: var(--muted); margin: -1rem 0 1.75rem; }
.ph { color: var(--accent) !important; font-style: italic; font-size: .92rem !important; opacity: .9; }

.grid.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.card p { color: var(--muted); margin-bottom: .75rem; }
.card.wide { grid-column: 1 / -1; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.icon { font-size: 1.8rem; }

.status, .draft { display: inline-block; font-size: .7rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; padding: .25rem .65rem; border-radius: 999px; font-style: normal; white-space: nowrap; }
.status.planned { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.status.inprog { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.draft { color: var(--accent); border: 1px dashed var(--accent); margin-bottom: 1rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .9rem; }
.tags span { font-size: .72rem; padding: .2rem .55rem; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted); }

/* Now */
.now { max-width: 820px; }
.now-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.now-head h3 { margin: 0; }
.checklist { list-style: none; margin: .5rem 0 1rem; }
.checklist li { padding: .45rem 0 .45rem 2rem; position: relative; color: var(--muted); border-bottom: 1px dashed var(--border); }
.checklist li::before { content: ""; position: absolute; left: 0; top: .7rem; width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 5px; }
.checklist li.doing { color: var(--text); font-weight: 500; }
.checklist li.doing::before { border-color: var(--accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* Steps */
.steps { list-style: none; margin: .5rem 0 1rem; display: grid; gap: .6rem; }
.steps li { display: grid; grid-template-columns: 70px 1fr auto; gap: .75rem; align-items: center; padding: .7rem .9rem; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--border); }
.steps b { font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--accent); }

/* Blog */
.post { display: flex; flex-direction: column; align-items: flex-start; border-style: dashed; }
.post .meta { margin-top: auto; font-size: .75rem; color: var(--muted); }

/* YouTube */
.yt { display: flex; align-items: center; gap: 1.75rem; }
.yt-icon { flex: none; width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, #ff0033, var(--accent)); }
.yt-body { flex: 1; }
.yt-body p { margin-bottom: .25rem; }

/* About / contact */
.about { display: flex; gap: 1.5rem; align-items: center; }
.avatar { flex: none; width: 110px; aspect-ratio: 1; border-radius: 50%; }
.placeholder { display: grid; place-items: center; text-align: center; border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); background: repeating-linear-gradient(45deg, var(--card), var(--card) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px); color: var(--muted); font-size: .85rem; font-weight: 500; }
.links { display: flex; flex-wrap: wrap; gap: .6rem; }
.link-pill { padding: .6rem 1.1rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); font-weight: 500; font-size: .92rem; transition: border-color .2s, color .2s; }
.link-pill:hover { border-color: var(--accent); color: var(--accent); }

.footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .88rem; text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .yt { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .nav nav { gap: .85rem; } .nav nav a { font-size: .82rem; }
  .nav nav a:nth-child(1), .nav nav a:nth-child(4) { display: none; }
  .hero { padding: 4rem 0 3.5rem; }
  .section { padding: 3.5rem 0; }
  .steps li { grid-template-columns: 1fr auto; }
  .steps li b { grid-column: 1 / -1; }
  .about { flex-direction: column; align-items: flex-start; }
  .btn { white-space: normal; }
}

/* Contact list */
.contact-list { display: grid; gap: .75rem; margin: .25rem 0 1.1rem; }
.contact-item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 12px; background: var(--bg-alt); border: 1px solid var(--border); transition: border-color .2s, transform .15s; }
.contact-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-item.primary { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--bg-alt)); }
.ci-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; background: var(--card); border: 1px solid var(--border); }
.contact-item.primary .ci-icon { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1205; border: none; }
.ci-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ci-text b { font-weight: 600; }
.ci-text small { color: var(--muted); font-size: .82rem; }
.ci-text .mono { color: var(--accent); font-size: .8rem; overflow-wrap: anywhere; }

/* Profile photo: always a perfect circle */
.about .avatar-photo,
.avatar-photo {
  display: block;
  box-sizing: border-box;
  width: 110px; height: 110px;
  min-width: 110px; min-height: 110px;
  max-width: none; max-height: none;
  aspect-ratio: 1 / 1;
  flex: 0 0 110px; flex-shrink: 0;
  align-self: center;
  object-fit: cover; object-position: center;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
@media (max-width: 600px) {
  .about { align-items: flex-start; }
  .about .avatar-photo, .avatar-photo {
    width: 96px; height: 96px; min-width: 96px; min-height: 96px; flex-basis: 96px; align-self: flex-start;
  }
}

/* Guard: nothing may stretch the profile photo */
img.avatar-photo, .about img.avatar-photo, .card img.avatar-photo {
  max-width: none !important; max-height: none !important;
  aspect-ratio: 1 / 1 !important; object-fit: cover !important; flex-grow: 0 !important; flex-shrink: 0 !important;
}

/* Projects grid: 2x2 small cards + full-width upgrade log */
.grid.three.lab-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.three.lab-grid { grid-template-columns: 1fr; } }

/* Site background: subtle tech grid + soft orange glows (fixed layer, no images) */
html { background: var(--bg); }
body { background: transparent; position: relative; }
body::before, body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body::before {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 40%, #000 35%, transparent 100%);
          mask-image: radial-gradient(ellipse 120% 90% at 50% 40%, #000 35%, transparent 100%);
}
body::after {
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    radial-gradient(circle at 92% 88%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 38%);
}
.section.alt { background: color-mix(in srgb, var(--bg-alt) 72%, transparent); }
