/* =========================================================================
   Timothy Myers · denvercoder.com
   Fresh design — dark-first, deep navy + cyan/green accent, mono details.
   ========================================================================= */

/* ------------------------------- Tokens -------------------------------- */
:root {
  --bg: #0a0e1a;
  --bg-2: #0f1526;
  --surface: #131a2e;
  --surface-2: #1a2338;
  --border: #24304d;
  --text: #e6ebf5;
  --muted: #93a1c0;
  --faint: #64748b;
  --accent: #35e0c8;      /* cyan-green */
  --accent-2: #6ea8fe;    /* soft blue */
  --accent-ink: #04211d;
  --danger: #ff6b6b;
  --warn: #ffd166;

  --font-sans: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(53, 224, 200, 0.35);
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --border: #dde4f0;
  --text: #101828;
  --muted: #475467;
  --faint: #8a94a6;
  --accent: #0bab90;
  --accent-2: #2f6bff;
  --accent-ink: #ffffff;
  --shadow: 0 18px 40px -22px rgba(16, 24, 40, 0.35);
}

/* --------------------------- Base / reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(80px + env(safe-area-inset-top, 0px)); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* clip (not hidden) prevents horizontal scroll WITHOUT making <body> a scroll
     container, which would change how the sticky header stacks/paints. */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

h1, h2, h3 { line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; }
.mono { font-family: var(--font-mono); }

.container { width: min(var(--maxw), 92vw); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 24px -8px rgba(53, 224, 200, 0.6);
}
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ------------------------------- Header -------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  /* Solid, fully opaque background. Do NOT rely on backdrop-filter for the
     header's opacity: Brave (and other browsers with fingerprint protection)
     block backdrop-filter at RENDER time while still reporting @supports=true,
     so a translucent header would let page content show through as you scroll.
     A solid color is the only bulletproof fix. */
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  /* iOS Safari: keep nav clear of the status bar / notch */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.brand-mark {
  font-family: var(--font-mono); color: var(--accent);
  background: var(--surface); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 7px; font-size: 0.9rem;
}
.brand-name { letter-spacing: -0.01em; }

.nav-menu {
  display: flex; align-items: center; gap: 6px;
  list-style: none; margin: 0; padding: 0;
}
.nav-menu a {
  padding: 8px 12px; border-radius: 8px; color: var(--muted);
  font-size: 0.95rem; font-weight: 500; transition: color 0.15s, background 0.15s;
}
.nav-menu a:hover { color: var(--text); background: var(--surface); }

.theme-toggle {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); width: 38px; height: 38px; border-radius: 9px;
  cursor: pointer; display: grid; place-items: center; transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-icon { width: 16px; height: 16px; display: inline-block; position: relative; }
.theme-icon::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: currentColor;
  -webkit-mask: radial-gradient(circle at 68% 32%, transparent 46%, #000 47%);
          mask: radial-gradient(circle at 68% 32%, transparent 46%, #000 47%);
}

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

/* -------------------------------- Hero --------------------------------- */
.hero { position: relative; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50rem 30rem at 78% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(40rem 26rem at 5% 8%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask: radial-gradient(60% 60% at 50% 30%, #000, transparent 75%);
          mask: radial-gradient(60% 60% at 50% 30%, #000, transparent 75%);
  opacity: 0.5;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted);
  margin: 0 0 1rem;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-title { font-size: clamp(2.8rem, 7vw, 4.5rem); margin: 0 0 0.5rem; }
.hero-role {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: clamp(1rem, 2.5vw, 1.35rem); margin: 0 0 1.4rem;
}
.hero-role .arrow { color: var(--faint); }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 600;
}
.hero-blurb { color: var(--muted); max-width: 46ch; font-size: 1.05rem; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.8rem; }

/* Terminal card */
.terminal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f56; } .dot.y { background: #ffbd2e; } .dot.g { background: #27c93f; }
.term-title { margin-left: 10px; font-size: 0.78rem; color: var(--faint); }
.term-body {
  margin: 0; padding: 20px 20px 22px; font-size: 0.9rem; line-height: 1.75;
  color: var(--text); white-space: pre-wrap;
}
.c-prompt { color: var(--accent); } .c-arrow { color: var(--faint); }
.c-hi { color: var(--accent); font-weight: 600; }

/* ------------------------------ Sections ------------------------------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px)); }
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 2rem;
  display: flex; align-items: baseline; gap: 14px;
}
.section-num {
  font-size: 0.9rem; color: var(--accent); font-weight: 500;
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 7px;
}
.section-lead { color: var(--muted); margin: -1rem 0 2rem; max-width: 60ch; }
.section-note { color: var(--faint); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 2rem; }
.card-label { color: var(--accent); font-size: 0.85rem; margin: 0 0 0.9rem; font-weight: 500; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.2rem; align-items: start; }
.about-body p { color: var(--muted); font-size: 1.05rem; }
.about-body strong { color: var(--text); }
.about-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }

.tick-list { list-style: none; margin: 0; padding: 0; }
.tick-list li { position: relative; padding-left: 1.5rem; margin-bottom: 0.55rem; color: var(--muted); }
.tick-list li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.skill-card h3 { font-size: 1.08rem; margin: 0 0 1rem; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.tag-list li {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}

/* Certifications (used when the hidden section is enabled) */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.cert-card {
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.cert-info { flex: 1 1 220px; }
.cert-btn { margin-left: auto; flex: none; white-space: nowrap; }
.cert-badge {
  flex: none; width: 76px; height: 76px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 600; font-size: 1rem;
  color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
/* Logo plate: fixed dark background so TCM's white wordmark stays legible in
   both light and dark themes. */
.cert-logo {
  flex: none; width: 140px; height: 84px;
  display: grid; place-items: center; padding: 14px 16px;
  background: #0f1526; border: 1px solid var(--border); border-radius: 12px;
}
.cert-logo img { max-width: 100%; max-height: 100%; display: block; }
.cert-info h3 { font-size: 1.05rem; margin: 0 0 0.2rem; }
.cert-issuer { color: var(--muted); margin: 0 0 0.6rem; font-size: 0.85rem; }
.cert-meta { list-style: none; margin: 0 0 0.6rem; padding: 0; font-size: 0.8rem; color: var(--faint); }
.cert-meta li { margin-bottom: 2px; }
.cert-verify { color: var(--accent); font-weight: 500; font-size: 0.9rem; }
.cert-verify:hover { text-decoration: underline; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0.8rem; }
.project-head h3 { font-size: 1.15rem; margin: 0; }
.pill {
  flex: none; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 4px 10px; border-radius: 999px;
}
.project-desc { color: var(--muted); font-size: 0.98rem; margin-bottom: 1.1rem; }
.project-link { display: inline-block; margin-top: 1rem; color: var(--accent); font-weight: 500; }

/* Experience timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 2rem 1.6rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.55rem; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.timeline-content h3 { font-size: 1.1rem; margin: 0 0 0.2rem; }
.timeline-meta { color: var(--faint); font-size: 0.82rem; margin: 0 0 0.7rem; }

/* Contact */
.contact-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.contact-item {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.4rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.contact-item:hover { transform: translateY(-4px); border-color: var(--accent); }
.contact-label { color: var(--faint); font-size: 0.78rem; }
.contact-value { font-size: 1.02rem; font-weight: 500; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.8rem 0; margin-top: 2rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner .mono { color: var(--faint); font-size: 0.82rem; }
.back-to-top { color: var(--muted); font-size: 0.82rem; }
.back-to-top:hover { color: var(--accent); }

/* ------------------------------ Responsive ----------------------------- */
/* Tablet: 2 columns of skills */
@media (max-width: 820px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Phone: single column of skills */
@media (max-width: 560px) {
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .terminal { order: -1; max-width: 420px; }
  .about-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; inset: calc(66px + env(safe-area-inset-top, 0px)) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px 6vw 20px;
    transform: translateY(-120%); transition: transform 0.28s ease;
    box-shadow: var(--shadow);
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-menu a { padding: 12px; }
  .nav-menu li:last-child { margin-top: 6px; }
  .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); }
}
