/* ---------------------------------------------------------------
   Naman Uttamchandani — personal site
   Palette: paper #F4F5F2 · ink #1B211E · muted #626B66
            line #DDE0DA · accent #B4530A · phosphor #F5A73B
   Type:    Archivo (display + body) · IBM Plex Mono (data)
--------------------------------------------------------------- */

:root {
  --paper: #f4f5f2;
  --ink: #1b211e;
  --muted: #626b66;
  --line: #dde0da;
  --accent: #b4530a;
  --device-bg: #12160f;
  --phosphor: #f5a73b;
  --maxw: 56rem;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85em;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- top bar ---------- */

.topbar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .cursor-block {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.topbar nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.topbar nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.topbar nav a:hover { color: var(--accent); }

/* ---------- layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- hero ---------- */

.hero { padding: 3.5rem 0 4.5rem; }

.device-wrap { margin-bottom: 2.75rem; max-width: 40rem; }

.device {
  background: var(--device-bg);
  border-radius: 10px;
  padding: clamp(0.75rem, 2.5vw, 1.25rem);
  box-shadow:
    inset 0 0 0 1px rgba(245, 167, 59, 0.08),
    0 1px 2px rgba(27, 33, 30, 0.25),
    0 12px 32px -12px rgba(27, 33, 30, 0.35);
}

#chip8 {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(245, 167, 59, 0.45));
}

.device-caption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

h1 {
  font-size: clamp(1.9rem, 8vw, 3.6rem);
  overflow-wrap: break-word;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 1.1rem;
}

.lede {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  line-height: 1.5;
  max-width: 40em;
  margin-bottom: 0.9rem;
}

.lede strong { font-weight: 600; }

.lede-sub {
  color: var(--muted);
  max-width: 44em;
  margin-bottom: 1.8rem;
}

.meta-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.meta-row li + li::before {
  content: "·";
  margin: 0 0.75rem;
  color: var(--line);
}

/* ---------- sections ---------- */

.section {
  border-top: 1px solid var(--line);
  padding: 3.25rem 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.addr {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- about ---------- */

.about p {
  max-width: 46em;
  color: #38403c;
  margin-bottom: 1rem;
}

.about p:last-child { margin-bottom: 0; }

.coursework {
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- experience ---------- */

.entry { margin-bottom: 2.5rem; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.dates {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.entry p {
  max-width: 46em;
  color: #38403c;
}

.metrics {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.metrics li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* ---------- projects ---------- */

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

.project {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  background: #fbfbf9;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -14px rgba(27, 33, 30, 0.35);
}

.project h3 a {
  color: var(--accent);
  text-decoration: none;
}

.project h3 a:hover { text-decoration: underline; }

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  font-size: 0.8rem;
}

.project p {
  font-size: 0.95rem;
  color: #38403c;
  flex-grow: 1;
}

.tags { color: var(--muted); font-size: 0.75rem; }

/* ---------- toolbox ---------- */

.toolbox {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 46em;
}

.toolbox dt {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.toolbox dd {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

/* ---------- contact ---------- */

.contact-lede { max-width: 42em; margin-bottom: 1.6rem; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-block;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  background: #fbfbf9;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- footer ---------- */

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- responsive / motion ---------- */

@media (max-width: 560px) {
  .hero { padding-top: 2.5rem; }
  .entry-head { flex-direction: column; gap: 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wordmark .cursor-block { animation: none; }
  .project, .btn { transition: none; }
  .project:hover { transform: none; }
}
