/* ============================================================
   Jason Tiet — Portfolio
   ============================================================ */

:root {
  --bg: #0b1120;
  --bg-elevated: #111a2e;
  --bg-card: #131e33;
  --border: #22304a;
  --text: #dbe4f3;
  --text-muted: #8b9bb8;
  --heading: #f1f5fb;
  --accent: #4cc9a4;
  --accent-strong: #35b18c;
  --accent-soft: rgba(76, 201, 164, 0.12);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 10px;
  --header-h: 68px;
  color-scheme: dark;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { color: var(--heading); line-height: 1.25; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
ul, ol { list-style: none; }
.accent { color: var(--accent); }

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #06121f;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: #06121f; }

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

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading);
}
.nav-logo:hover { color: var(--accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

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

.nav-cta {
  padding: 8px 16px;
  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;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--heading);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding-top: 48px;
  padding-bottom: 64px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #06121f;
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: #06121f;
  box-shadow: 0 6px 20px -6px var(--accent);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-lg { padding: 15px 34px; font-size: 1.02rem; }

/* ---------- Terminal ---------- */
.hero-terminal {
  margin-top: 56px;
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red { background: #f4655f; }
.dot-yellow { background: #f5bd4f; }
.dot-green { background: #61c454; }
.terminal-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
  overflow-x: auto;
}
.t-prompt { color: var(--accent); font-weight: 500; }
.t-out { color: var(--text-muted); }
.t-cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: 88px 24px; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 42px;
  white-space: nowrap;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 400;
  color: var(--accent);
}
.section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 320px;
  background: var(--border);
  transform: translateY(-6px);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p + p { margin-top: 16px; }
.about-text { color: var(--text-muted); }

.about-facts {
  display: grid;
  gap: 16px;
}
.fact-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fact-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}
.fact-label { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.skill-card {
  padding: 26px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.skill-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.skill-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.skill-card > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Experience / Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 44px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 8px; }

.timeline-marker {
  position: absolute;
  left: -44px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 12px;
}
.timeline-head h3 { font-size: 1.12rem; }
.at { color: var(--accent); font-weight: 600; margin-left: 8px; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-points {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.timeline-points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}
.timeline-points li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Education ---------- */
.education { margin-top: 48px; }
.education-title {
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.education-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.education-card strong { color: var(--heading); font-size: 1.02rem; }
.education-card p { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Featured Work ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.project-folder { color: var(--accent); }
.project-metric {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  white-space: nowrap;
}

.project-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.project-card > p {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 18px;
}

/* ---------- Contact ---------- */
.section-contact {
  text-align: center;
  padding-bottom: 110px;
}
.section-contact .section-title {
  justify-content: center;
}
.section-contact .section-title::after { display: none; }

.contact-blurb {
  max-width: 540px;
  margin: 0 auto 32px;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 40px;
}
.social-links a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .t-cursor { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-facts { grid-template-columns: repeat(3, 1fr); }
}

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

  .nav-menu {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu li { padding: 10px 0; }
  .nav-menu a { display: block; font-size: 1rem; }
  .nav-cta { text-align: center; }

  .about-facts { grid-template-columns: 1fr; }
  .section { padding: 64px 24px; }
  .section-title::after { max-width: 120px; }
  .timeline-head { flex-direction: column; }
}
