/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  /* Backgrounds */
  --bg: #f4f6f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: #e1e6ec;

  /* Text */
  --text: #1b2430;
  --text-muted: #55606c;
  --text-faint: #7c8894;

  /* Accent (teal — terminal/infra feel without being neon) */
  --accent: #0b7a70;
  --accent-dim: #0c766c;
  --accent-bg: rgba(11, 122, 112, 0.1);
  --danger: #b3261e;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --nav-height: 64px;
  --max-width: 1100px;
  --radius: 8px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

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

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

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

main {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

section {
  padding: 72px 0;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 8px;
}

.section-kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section-intro {
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(244, 246, 249, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.navbar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
}

.nav-toggle .bar {
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--accent);
}

/* Mobile nav */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links.open {
    max-height: 400px;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a.active::after {
    display: none;
  }

  .nav-toggle.open .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.open .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #58e0d0;
  color: #04120f;
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}

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

/* ==========================================================================
   Cards (reused by Projects / Skills / About)
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer-inner a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 20px;
}

/* ==========================================================================
   Page heading (used by interior pages: About, Projects, Skills, Resume, Contact)
   ========================================================================== */
.page-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Hero (Home page)
   ========================================================================== */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 48px;
}

.hero-name {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.1;
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--accent);
  font-weight: 500;
  margin-top: 8px;
  margin-bottom: 24px;
}

.hero-summary {
  max-width: 600px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  width: 100%;
}

@media (min-width: 760px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 56px;
  }
}

.hero-photo-wrap {
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: top center;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 32, 0.12);
}

/* ==========================================================================
   Grid layouts
   ========================================================================== */
.grid {
  display: grid;
  gap: 24px;
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* ==========================================================================
   Badges & tags
   ========================================================================== */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-flagship {
  background: var(--accent);
  color: #ffffff;
}

.badge-progress {
  background: var(--border);
  color: var(--text-muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-dim);
  border: 1px solid var(--border);
}

/* ==========================================================================
   Bullet lists (custom marker — ul is reset globally)
   ========================================================================== */
.bullet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
}

.bullet-list li {
  position: relative;
  padding-left: 4px;
  color: var(--text-muted);
}

.bullet-list li::before {
  content: "▸";
  position: absolute;
  left: -18px;
  color: var(--accent);
}

/* ==========================================================================
   Cards: hover lift (used by Project cards)
   ========================================================================== */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15, 23, 32, 0.08);
  border-color: var(--accent);
}

/* ==========================================================================
   Placeholder note (visually flags unfinished content in the source)
   ========================================================================== */
.placeholder-note {
  font-style: italic;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card h2 {
  font-size: 1.15rem;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card p {
  color: var(--text-muted);
}

.project-flagship {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 32px;
}

.project-flagship h2 {
  font-size: 1.5rem;
  margin-top: 4px;
}

/* ==========================================================================
   Timeline (Resume / About — Experience & Education)
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-item h3 {
  font-size: 1.05rem;
}

.timeline-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.timeline-item .bullet-list {
  margin-top: 10px;
}

.resume-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ==========================================================================
   Forms (Contact, Resume request)
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  display: none;
  font-size: 0.9rem;
  margin-top: 14px;
}

.form-status.success {
  display: block;
  color: var(--accent);
}

.form-status.error {
  display: block;
  color: var(--danger);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-card {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.contact-card p {
  color: var(--text-muted);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
}

/* ==========================================================================
   Skills page
   ========================================================================== */
.skill-card h2 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.skill-card-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
