/* LeetCamp styles, built up day by day */

/* ---------- 1. Design tokens ---------- */

:root {
  --bg: #0f0d1a;
  --surface: #14111f;
  --surface-2: #181525;
  --border: #2a2640;
  --text: #ece9ff;
  --muted: #9893b8;
  --accent: #b88cff;
  --g1: #7c83e8;
  --g2: #c77dd0;
  --g3: #f0699f;
  --gradient: linear-gradient(90deg, var(--g1), var(--g2), var(--g3));
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- 2. Reset & base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before { content: "// "; opacity: 0.6; }

.section-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 14px;
}

.section-lead { color: var(--muted); max-width: 680px; font-size: 1.05rem; }

/* ---------- 3. Navbar ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 13, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 8px; }

.nav-links a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--surface-2); }

/* ---------- 4. Tools showcase (pure-CSS tabs) ---------- */

.showcase { padding: 80px 0 90px; }

.showcase-head { margin-bottom: 36px; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.tab {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.tab:hover { border-color: #4a4270; transform: translateY(-1px); }

.tab strong { display: block; font-size: 0.95rem; }

.tab small { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

#t-scratch:checked ~ .tabs label[for="t-scratch"],
#t-html:checked    ~ .tabs label[for="t-html"],
#t-css:checked     ~ .tabs label[for="t-css"],
#t-js:checked      ~ .tabs label[for="t-js"] {
  border-color: var(--accent);
  background: #1b1733;
  box-shadow: 0 0 0 1px rgba(184, 140, 255, 0.25);
}

.tabset:has(#t-scratch:focus-visible) label[for="t-scratch"],
.tabset:has(#t-html:focus-visible)    label[for="t-html"],
.tabset:has(#t-css:focus-visible)     label[for="t-css"],
.tabset:has(#t-js:focus-visible)      label[for="t-js"] { outline: 2px solid var(--g3); outline-offset: 2px; }

.panel { display: none; }

#t-scratch:checked ~ .panels .p-scratch,
#t-html:checked    ~ .panels .p-html,
#t-css:checked     ~ .panels .p-css,
#t-js:checked      ~ .panels .p-js { display: block; animation: fade 0.3s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.window {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }

.dot.r { background: #ff5f57; }

.dot.y { background: #febc2e; }

.dot.g { background: #28c840; }

.filename { margin-left: 10px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

.window-body { display: grid; grid-template-columns: 1.15fr 1fr; }

.code-side { padding: 26px 20px; overflow-x: auto; background: #110e1d; }

.info-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border-left: 1px solid var(--border);
  background: var(--surface-2);
}

.info-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.info-side h3 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 10px; }

.info-side p { color: #d4d0ee; margin-bottom: 14px; }

.info-side ul { list-style: none; display: grid; gap: 8px; }

.info-side li { position: relative; padding-left: 22px; color: #c4bfe3; font-size: 0.95rem; }

.info-side li::before { content: "›"; position: absolute; left: 4px; color: var(--g3); font-weight: 700; }

.info-foot { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }

.code { counter-reset: line; font-family: var(--mono); font-size: 0.86rem; line-height: 1.9; }

.line { white-space: pre; padding-left: 38px; position: relative; color: var(--text); }

.line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute; left: 0; width: 22px; text-align: right;
  color: #4a4568;
}

.tag  { color: #ff7b72; }

.attr { color: #ffb454; }

.str  { color: #f3a0c8; }

.com  { color: #6c6790; font-style: italic; }

.fn   { color: #79c0ff; }

.scratch { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }

.stack { display: grid; gap: 2px; font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: #fff; }

.blk { padding: 7px 12px; border-radius: 6px; width: fit-content; min-width: 190px; }

.blk.hat { border-radius: 16px 16px 6px 6px; padding-top: 10px; }

.blk.indent { margin-left: 22px; min-width: 168px; }

.blk.indent2 { margin-left: 44px; min-width: 146px; }

.blk.event   { background: #ffbf00; color: #4a3600; }

.blk.control { background: #ffab19; color: #4a3000; }

.blk.vars    { background: #ff8c1a; }

.blk.motion  { background: #4c97ff; }

.blk.looks   { background: #9966ff; }

.blk.custom  { background: #ff6680; }

.blk.sensing { background: #5cb1d6; }

.pill { display: inline-block; padding: 1px 9px; margin: 0 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.92); color: #333; font-weight: 600; }

/* ---------- 5. How we do it ---------- */

.how { padding: 80px 0 90px; border-top: 1px solid var(--border); background: linear-gradient(180deg, var(--bg), #0c0a15); }

.how-head { margin-bottom: 40px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.card {
  position: relative;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover { transform: translateY(-4px); border-color: #4a4270; }

.card .num {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 12px;
  background: var(--gradient);
  font-family: var(--mono); font-weight: 700; color: #0f0d1a;
}

.card h3 { font-size: 1.25rem; margin-bottom: 8px; }

.card p { color: var(--muted); font-size: 0.96rem; }

.card .loop { margin-top: 16px; font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }

/* ---------- 6. Who I am page ---------- */

.about { padding: 70px 0 90px; }

.profile {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, #1a1630, var(--surface));
  margin-bottom: 24px;
}

.avatar {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--gradient);
  font-size: 3rem; font-weight: 800; color: #0f0d1a;
}

.profile h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; }

.profile .tagline { color: var(--muted); margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chip { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-family: var(--mono); font-size: 0.75rem; color: var(--accent); background: var(--surface); }

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.about-grid .wide { grid-column: 1 / -1; }

.about-card { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

.about-card h2 { font-size: 1.1rem; margin-bottom: 10px; }

.about-card p, .about-card li { color: #c4bfe3; }

.about-card ul { padding-left: 20px; display: grid; gap: 4px; }

.quiz-box { padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }

.quiz-q { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }

.quiz-options { display: flex; flex-wrap: wrap; gap: 10px; }

.quiz-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.quiz-btn:hover { border-color: var(--accent); background: #1b1733; }

.quiz-result { margin-top: 14px; min-height: 1.6em; font-weight: 600; color: var(--accent); }

/* ---------- 7. Footer ---------- */

.footer { border-top: 1px solid var(--border); background: #0b0914; padding: 56px 0 28px; }

.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }

.footer .brand { display: inline-block; margin-bottom: 10px; }

.footer p { color: var(--muted); font-size: 0.92rem; max-width: 340px; }

.footer h4 { font-size: 0.8rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 12px; }

.footer ul { list-style: none; display: grid; gap: 8px; }

.footer li a, .footer li { color: var(--muted); font-size: 0.92rem; }

.footer li a:hover { color: var(--text); }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.82rem;
}

/* ---------- 8. Responsive ---------- */

@media (max-width: 860px) {
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .window-body { grid-template-columns: 1fr; }
  .info-side { border-left: 0; border-top: 1px solid var(--border); }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
  .profile { flex-direction: column; text-align: center; padding: 26px 20px; }
  .chips { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .nav-links a { padding: 8px 10px; font-size: 0.88rem; }
  .code { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
