/* ============================================================
   Aiver Keith — portfolio styles
   Dark by default, light when the OS asks for it.
   ============================================================ */

:root {
  --bg: #0d1117;
  --bg-raised: #161b22;
  --bg-hover: #1c2330;
  --text: #e6edf3;
  --text-muted: #9aa7b4;
  --accent: #4cc9a4;
  --accent-soft: rgba(76, 201, 164, 0.12);
  --border: #2a3340;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafbfc;
    --bg-raised: #ffffff;
    --bg-hover: #f0f3f6;
    --text: #1b2733;
    --text-muted: #5a6b7b;
    --accent: #0f8a6d;
    --accent-soft: rgba(15, 138, 109, 0.1);
    --border: #dde3ea;
    --shadow: 0 8px 24px rgba(27, 39, 51, 0.08);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(960px, 100% - 3rem);
  margin-inline: auto;
}

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

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-menu a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-menu a:hover { color: var(--accent); text-decoration: none; }

.nav-cta {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent) !important;
}
.nav-cta:hover { background: var(--accent-soft); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

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

.hero {
  padding: clamp(4rem, 12vh, 8rem) 0 3rem;
}

.hero-kicker {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.hero-name {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.hero-blurb {
  max-width: 560px;
  color: var(--text-muted);
  margin-top: 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }

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

.section { padding: 4.5rem 0; }

.section-title {
  font-size: 1.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.section-title::after {
  content: "";
  flex: 1;
  max-width: 240px;
  height: 1px;
  background: var(--border);
  margin-left: 0.75rem;
}

.section-num {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem;
}

.section-lead { color: var(--text-muted); margin-bottom: 1.75rem; }

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2.5rem;
  align-items: start;
}

.about-text p { margin-bottom: 1rem; color: var(--text-muted); }
.about-text em { color: var(--text); font-style: normal; font-weight: 600; }

.skills-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 0.4rem 1.5rem;
  margin-top: 0.5rem;
}
.skills-list li {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
}
.skills-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.photo-frame {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 3rem;
  font-weight: 700;
  background: var(--accent-soft);
}

/* ---------- project cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.card-icon { font-size: 1.8rem; }
.card-links a {
  font-size: 1.2rem;
  color: var(--text-muted);
}
.card-links a:hover { color: var(--accent); text-decoration: none; }

.card-title { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.card-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.card-tags li {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

/* ---------- apps ---------- */

.app-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.app-row:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--bg-hover);
}
.app-row:hover .app-arrow { transform: translateX(4px); }

.app-icon { font-size: 1.6rem; }

.app-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.app-name { font-weight: 600; }
.app-blurb {
  color: var(--text-muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  white-space: nowrap;
}
.app-live { color: var(--accent); }
.app-soon { color: var(--text-muted); }

.app-arrow {
  color: var(--accent);
  transition: transform 0.15s;
}

.app-row-disabled {
  opacity: 0.6;
  cursor: default;
}
.app-row-disabled:hover {
  border-color: var(--border);
  background: var(--bg-raised);
}

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

.section-contact { text-align: center; padding-bottom: 6rem; }
.section-contact .section-title { justify-content: center; }
.section-contact .section-title::after { display: none; }
.contact-lead {
  max-width: 480px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.social-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.social-links a { color: var(--text-muted); font-size: 0.9rem; }
.social-links a:hover { color: var(--accent); }

.footer-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- mobile ---------- */

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

  .nav-menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu li { width: 100%; text-align: center; }
  .nav-menu a { display: block; padding: 0.9rem; }
  .nav-cta { border: none; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 200px; }
}
