/* ---------- Fonts ---------- */
@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/special-elite.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a0a;
  --text: #ededed;
  --muted: #9ca3af;
  --border: #262626;
  --link: #f472b6;
  --link-hover: #f9a8d4;
  --accent: #f472b6;
  --font: "Special Elite", "Courier New", ui-monospace, Menlo, Consolas, monospace;
  --maxw: 640px;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #171717;
  --muted: #6b7280;
  --border: #e5e7eb;
  --link: #ec4899;
  --link-hover: #db2777;
  --accent: #ec4899;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0 0 1rem; }
strong { font-weight: 650; color: var(--accent); }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-style: normal; letter-spacing: normal; margin-right: .15em; }

/* Tech tooltips */
.tech { position: relative; color: var(--muted); font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; font-weight: 300; letter-spacing: 0; border-bottom: 1px dotted var(--muted); cursor: help; }
.tech:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
.tech-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  display: grid; place-items: center; width: 64px; height: 64px; padding: 12px;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity .15s ease, transform .15s ease; z-index: 20;
}
.tech-tip img { display: block; width: 40px; height: 40px; }
.tech-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
}
.tech:hover .tech-tip, .tech:focus-within .tech-tip {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
@media (prefers-reduced-motion: reduce) { .tech-tip { transition: none; } }

/* Active nav link */
.nav-links a[aria-current="page"] { color: var(--text); }

/* Page header (non-home pages) */
.page-head { margin-bottom: 2.2rem; }
.page-head h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.page-head .lead { color: var(--muted); margin: 0; }

/* Projects */
.project h3 a { color: var(--text); }
.project h3 a:hover { color: var(--link); }
.project .tags { color: var(--muted); font-size: .82rem; margin-top: .5rem; letter-spacing: .02em; }

/* Skills */
.skills-group { margin-bottom: 1.6rem; }
.skills-group:last-child { margin-bottom: 0; }

/* Logo grid */
.logo-grid { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }
.logo-grid li { display: grid; justify-items: center; gap: 8px; width: 84px; color: var(--muted); font-size: .8rem; }
.logo-grid .chip { display: grid; place-items: center; width: 60px; height: 60px; background: #fff; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.logo-grid .chip img { width: 34px; height: 34px; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 10; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header { padding: 28px 0 8px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: .01em; }
.brand:hover { text-decoration: none; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--muted); font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- Sections ---------- */
main { padding-top: clamp(56px, 12vw, 96px); }
section { margin-bottom: 56px; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .35rem; }
.role { color: var(--muted); margin-bottom: 1.4rem; }
h2 { font-size: 1.05rem; font-weight: 650; margin-bottom: 1.2rem; letter-spacing: -.01em; }

.quick-links { color: var(--muted); display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.4rem; }

/* Work entries */
.entry { padding: 1.3rem 0; border-top: 1px solid var(--border); }
.entry:first-of-type { padding-top: 0; border-top: 0; }
.entry:last-child { padding-bottom: 0; }
.entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem 1rem; margin-bottom: .5rem; }
.entry-head h3 { font-size: 1rem; font-weight: 650; }
.entry-meta { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.entry p { margin: 0; color: var(--muted); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { margin-bottom: 1rem; color: var(--muted); }
.list li:last-child { margin-bottom: 0; }
.list a { font-weight: 600; }

/* Skills */
.skills { margin: 0; display: grid; gap: .9rem; }
.skills dt { color: var(--text); font-weight: 600; font-size: .95rem; margin-bottom: .1rem; }
.skills dd { margin: 0; color: var(--muted); }

/* Contact */
#contact p { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 48px; }
.site-footer p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .site-header { padding-top: 22px; }
  .nav { gap: .6rem; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: .9rem; }
  h1 { font-size: 1.7rem; }
  .entry-meta { white-space: normal; }
}
