/* ============================================
   BASE
   ============================================ */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }

p { color: var(--ink-soft); margin: 0 0 1em; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.9em;
}
.eyebrow::before { content: "$";  }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color 0.15s ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(.22,1,.36,1);
}
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
}

/* Theme switch — styled like a terminal power toggle */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: border-color 0.15s ease, transform 0.15s cubic-bezier(.34,1.56,.64,1);
}
.theme-switch:hover { border-color: var(--accent); }
.theme-switch:active { transform: scale(0.94); }
.theme-switch__track {
  width: 40px; height: 20px;
  border-radius: 999px;
  background: var(--ink);
  position: relative;
  transition: background 0.2s ease;
}
.theme-switch__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
}
html[data-theme="dark"] .theme-switch__thumb { transform: translateX(20px); }
.theme-switch__label { color: var(--ink-soft); padding-right: 4px; }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero__tagline { font-size: 1.1rem; max-width: 46ch; }
.hero__actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.hero__terminal-wrap { position: relative; }

.hero__terminal {
  background: var(--ink);
  color: #C9E8E4;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  line-height: 1.7;
  min-height: 176px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s cubic-bezier(.22,1,.36,1);
}
.hero__terminal:hover { box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow); }
.hero__terminal:active { transform: scale(0.995); }
html[data-theme="dark"] .hero__terminal { background: #050810; border: 1px solid var(--border); }
.hero__terminal .dim { color: #6E8B87; }
.hero__terminal .accent { color: #35D6C0; }
.hero__terminal .caret {
  display: inline-block; width: 7px; height: 14px;
  background: #35D6C0; vertical-align: -2px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__terminal-hint {
  text-align: right;
  color: var(--ink-faint);
  margin-top: 8px;
  opacity: 0.8;
}

/* ============================================
   PET MASCOT
   ============================================ */
.pet {
  position: absolute;
  right: -18px;
  bottom: -34px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}
.pet svg { display: block; animation: pet-bob 3.2s ease-in-out infinite; }
.pet:hover svg { animation-duration: 1s; }

.pet__eyes ellipse { animation: pet-blink 4.5s ease-in-out infinite; transform-origin: center; }
.pet__tail {
  fill: var(--accent-strong);
  transform-origin: 18px 72px;
  animation: pet-tail 2.6s ease-in-out infinite;
}

@keyframes pet-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes pet-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
@keyframes pet-tail {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-16deg); }
}

.pet--bounce svg { animation: pet-pounce 0.5s cubic-bezier(.34,1.56,.64,1); }
@keyframes pet-pounce {
  0% { transform: scale(1) translateY(0); }
  40% { transform: scale(0.92, 1.08) translateY(-10px); }
  100% { transform: scale(1) translateY(0); }
}

.pet__bubble {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.pet__bubble.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.pet__bubble::after {
  content: "";
  position: absolute;
  top: 100%; right: 18px;
  border: 6px solid transparent;
  border-top-color: var(--surface);
}

@media (max-width: 520px) {
  .pet { transform: scale(0.8); right: -10px; bottom: -22px; }
  .pet__bubble { white-space: normal; max-width: 160px; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.btn--primary:hover { background: var(--accent-strong); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 60%, transparent); }

.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-alt); border-color: var(--accent); color: var(--accent); }

/* ============================================
   SECTIONS / CARDS
   ============================================ */
.section { padding: 64px 0; }
.section--alt { background: var(--surface-alt); }
.section--tight { padding-bottom: 0; }
.lede { max-width: 60ch; }
.section__head { max-width: 62ch; margin-bottom: 36px; }

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.22s cubic-bezier(.22,1,.36,1), border-color 0.2s ease, box-shadow 0.22s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 16px 32px -14px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.15s cubic-bezier(.34,1.56,.64,1), background 0.15s ease;
}
.tag:hover { transform: translateY(-2px) scale(1.04); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--ok { background: var(--ok-soft); color: var(--ok); }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }

.card__links { display: flex; gap: 14px; margin-top: auto; padding-top: 6px; font-size: 0.88rem; }

/* Timeline (Achievements) */
.timeline { border-left: 2px solid var(--border); margin-left: 6px; }
.timeline__item { position: relative; padding: 0 0 32px 28px; }
.timeline__item::before {
  content: "";
  position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}
.timeline__date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }

/* Blog list */
.blog-card { cursor: pointer; }
.blog-card__meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.blog-card__excerpt { flex: 1; }
.blog-card__read { font-size: 0.85rem; font-weight: 600; color: var(--accent); }

/* Modal for full blog post */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 12, 18, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 100;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow);
}
.modal__close {
  float: right;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  cursor: pointer;
  color: var(--ink);
}
.modal__body p { color: var(--ink-soft); }

/* Contact links */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.22s cubic-bezier(.22,1,.36,1), border-color 0.2s ease, box-shadow 0.22s ease;
}
.contact-link:hover {
  text-decoration: none;
  transform: translateY(-4px) translateX(2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 16px 32px -14px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow);
}
.contact-link:active { transform: translateY(-1px) scale(0.99); }
.contact-link__icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex-shrink: 0;
}
.contact-link__body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.contact-link__label { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.contact-link__handle { color: var(--ink-faint); font-size: 0.78rem; }
.contact-link__arrow {
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.contact-link:hover .contact-link__arrow { transform: translate(3px, -3px); }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.22,1,.36,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  position: relative;
  margin-bottom: 22px;
}
.avatar::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
/*@keyframes spin { to { transform: rotate(360deg); } }*/

/* ============================================
   STATS ROW
   ============================================ */
.stats { border-bottom: 1px solid var(--border); background: var(--surface); }
.stats__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 28px 24px;
}
.stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.stats__item:hover { transform: translateY(-3px); }
.stats__num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.stats__label { color: var(--ink-faint); font-size: 0.72rem; }

@media (max-width: 640px) {
  .stats__row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   SCAN WIDGET (interactive demo)
   ============================================ */
.scan-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.scan-widget__head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.scan-widget__hint { color: var(--ink-faint); font-size: 0.72rem; }
.scan-widget__output {
  background: var(--ink);
  color: #C9E8E4;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  min-height: 64px;
  font-size: 0.82rem;
  line-height: 1.8;
}
html[data-theme="dark"] .scan-widget__output { background: #050810; border: 1px solid var(--border); }
.scan-widget__output:empty::before {
  content: "Output will appear here.";
  color: #6E8B87;
}
.scan-line { opacity: 0; animation: scan-in 0.3s ease forwards; }
@keyframes scan-in { to { opacity: 1; } }
.scan-line .ok { color: #35D6C0; }
.scan-line.scan-line--final {
  color: #35D6C0;
  font-weight: 600;
  margin-top: 6px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  margin-top: 40px;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.footer__links { display: flex; gap: 16px; }
.footer__links a { color: var(--ink-soft); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; align-items: center; }
  .nav__right { position: relative; }
  .nav__links {
    position: absolute;
    top: calc(100% + 16px); left: -24px; right: -24px;
    width: 100vw;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 24px 16px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 8px; }
  .theme-switch__label { display: none; }
}
