/*
  styles.css
  Purpose: Controls the visual design and responsive layout for the portfolio.
  Sections:
  - Theme variables and base page styles
  - Header, hero, panels, project cards, timeline, and contact styles
  - Anime.js background/intro loader styles
  - Responsive layout and reduced-motion support
*/

/* Theme tokens: update these first when changing the overall color palette. */
:root {
    --olive-green: #7A8A4F;
    --sag-green: #8B6B3F;
    --cream: #E4CFAE;
    --sand-cream: #8B6B3F;
    --espresso-brown: #3E3026;

    --bg: var(--cream);
    --bg-soft: #E4CFAE;
    --panel: #E4CFAE;
    --panel-strong: #E4CFAE;
    --text: var(--espresso-brown);
    --muted: #705239;
    --accent: var(--olive-green);
    --accent-dark: #4F6530;
    --accent-soft: var(--sag-green);
    --accent-warm: var(--sand-cream);
    --border: #8B6B3F;
    --radius: 24px;
}

/* Base reset: keeps element sizing predictable across browsers. */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Page base: the gradient is the main site background. */
html {
    scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #3E3026 0%, #705239 45%, #7A8A4F 100%);
  min-height: 100vh;
}

body::before {
  content: none;
}

/* Main page width wrapper. */
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* Shared section spacing and section heading scale. */
.section {
  padding: 96px 0;
}

.section-heading h2 {
  color: var(--espresso-brown);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.kicker {
  color: var(--olive-green);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

/* Sticky top navigation and brand mark. */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 20;
  margin-top: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--espresso-brown);
    font-weight: 800;
}
.brand__mark {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--olive-green);
    color: var(--cream);
    font-family: "IBM Plex Mono", monospace;
}

.brand__label {
  color: var(--cream);
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  transition: 0.2s ease;
}

.site-nav a:hover, .site-nav a.is-active {
  background: #D9BC8F;
  color: var(--cream);
}

/* Hero: first viewport introduction and summary panel. */
.section--hero {
  min-height: calc(100vh - 90px);
  display: grid;
  align-items: center;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
}
.hero__content h1{
 margin: 0;
 font-size: clamp(3rem, 7vw, 6.4rem);
 line-height: 0.92;
 letter-spacing: -0.08em;
 color: var(--cream);
}

.hero__intro {
  max-width: 720px;
  margin-top: 24px;
  color: var(--cream);
  font-size: 1.18rem;
  line-height: 1.7;
}

/* Reusable buttons and hero call-to-action layout. */
.cta-group {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: 0.22s ease;
}

.button--primary {
    color: var(--cream);
    background: var(--sand-cream);
    border: 1px solid var(--espresso-brown);
}

.button--secondary {
    color: var(--cream);
    border: 1px solid var(--espresso-brown);
    background: var(--sand-cream);
}
.button:hover {
    transform: translateY(-2px);
}


/* Hero signal list under the call-to-action buttons. */
.hero__signals {
  margin-top: 28px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.hero__signals li::before {
  content: "▹";
  color: var(--olive-green);
  margin-right: 10px;
}


.hero__signals,
.hero__signals li::before {
  color: var(--cream);
}

/* Shared card/panel foundation used across the site. */
.panel,
.skill-card,
.project-card,
.timeline-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel {
  padding: 28px;
}

.hero__panel {
  position: relative;
  overflow: hidden;
}

/* Decorative overlay disabled to keep the current design flat. */
.hero__panel::before {
  content: none;
  position: absolute;
  inset: -1px;
  background: var(--panel);
  pointer-events: none;
}

/* Shared body text color inside cards. */
.panel__body,
.skill-card p,
.timeline-card p {
  color: var(--muted);
  line-height: 1.7;
}

.checklist h3,
.checklist li,
.checklist li::marker {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--cream);
  background: var(--olive-green);
  border: 1px solid var(--olive-green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

/* Project grid and project cards. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.project-card {
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--olive-green);
}

.project-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--espresso-brown);
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.project-card:hover .project-card__media img {
  transform: scale(1.05);
}

.project-card__content {
  padding: 24px;
}

.project-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--olive-green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-card h3 {
  margin-top: 18px;
  margin-bottom: 10px;
  font-size: 1.7rem;
  color: var(--espresso-brown);
}

.project-card p {
  color: var(--muted);
  line-height: 1.65;
}

/* Tag pills used in project cards and the hero skill list. */
.project-card__tags,
.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card__tags span,
.stack-list span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--espresso-brown);
  background: #D9BC8F;
  border: 1px solid var(--sand-cream);
  font-size: 0.82rem;
}

.project-card__button {
  margin-top: 18px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  color: var(--cream);
  background: linear-gradient(135deg, #587330, #87975B);
  border: 1px solid var(--olive-green);
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.project-card__button:hover {
  transform: translateY(-2px);
}

/* Project category filters. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-chip {
  border: 1px solid var(--border);
  color: var(--espresso-brown);
  background: #D9BC8F;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: var(--cream);
  background: var(--olive-green);
  border-color: var(--olive-green);
}

/* Spotlight panel updated by main.js when a Project Brief button is clicked. */
.project-spotlight {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
  background: var(--panel);
}

.project-spotlight__media {
  border-radius: 18px;
  overflow: hidden;
  background: var(--espresso-brown);
  border: 1px solid var(--border);
}

.project-spotlight__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-spotlight__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--olive-green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.project-spotlight h3 {
  font-size: 2rem;
  line-height: 1.12;
  color: var(--espresso-brown);
}

.project-spotlight__highlights {
  color: var(--muted);
  line-height: 1.7;
}

/* Duplicate spotlight block kept for the existing cascade; values mirror the block above. */
.project-spotlight {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
  background: var(--panel);
}

.project-spotlight__media {
  border-radius: 18px;
  overflow: hidden;
  background: var(--espresso-brown);
  border: 1px solid var(--border);
}

.project-spotlight__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-spotlight__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--olive-green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.project-spotlight__highlights {
  color: var(--muted);
  line-height: 1.7;
}
/* Section grids for about, skills, timeline, and contact areas. */
.about-grid,
.skill-grid,
.timeline-grid,
.contact-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.skill-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skill-card,
.timeline-card {
  padding: 24px;
}

/* Small labels used inside cards. */
.skill-card__index,
.timeline-card__label,
.panel__eyebrow,
.signal-card__label {
  color: var(--olive-green);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.skill-card h3,
.timeline-card h3 {
  color: var(--espresso-brown);
  font-size: 1.45rem;
}

/* Timeline and contact section emphasis. */
.contact-panel {
  padding: 28px;
}

.timeline-card .timeline-card__label,
.contact-panel .panel__eyebrow {
  color: var(--accent-dark);
}

.timeline-card h3,
.contact-panel h3 {
  color: var(--accent-dark);
}

.contact-panel__copy {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Contact links are styled as buttons for email, social links, and resume PDF. */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 12px 16px;
  border-radius: 999px;

  color: var(--cream);
  background: linear-gradient(135deg, #4F6530, #768748);
  border: 1px solid var(--accent-dark);

  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;

  transition: transform 0.22s ease, filter 0.22s ease;
}

.contact-links a:hover {
  transform: translateY(-3px);
}

.contact-links a:active {
  transform: translateY(-1px);
}

.contact-links a[href^="mailto"]::before {
  content: "✉";
}

.contact-links a[href*="github"]::before {
  content: "⌘";
}

.contact-links a[href*="linkedin"]::before {
  content: "in";
  font-family: "IBM Plex Mono", monospace;
  font-weight: 800;
}

.contact-links a[href$=".pdf"]::before {
  content: "↗";
}

/* Page positioning for the fixed code background layer. */
body {
  position: relative;
  overflow-x: hidden;
}

.page-shell {
  position: relative;
  z-index: 2;
}

/* Background code layer controlled by assets/js/code-background.js. */
.code-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.code-bg.is-rendered {
  opacity: 0.18;
}

.code-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cream);
}

/* Container where JavaScript injects animated code snippets. */
#code-stream {
  position: absolute;
  inset: 0;
}

.code-symbol {
  position: absolute;
  color: var(--olive-green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  user-select: none;
}

/* Intro terminal overlay animated by Anime.js. */
.intro-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3E3026 0%, #705239 45%, #7A8A4F 100%);
}

.terminal-card {
  width: min(680px, calc(100% - 32px));
  padding: 28px;
  border-radius: 24px;
  background: #705239;
  border: 1px solid var(--cream);
  font-family: "IBM Plex Mono", monospace;
}

.terminal-label {
  margin: 0 0 18px;
  color: var(--cream);
  letter-spacing: 0.18em;
  font-size: 0.75rem;
}

.boot-line {
  margin: 10px 0;
  color: var(--cream);
  opacity: 0;
  transform: translateY(8px);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .hero,
  .about-grid,
  .skill-grid,
  .project-grid,
  .project-spotlight,
  .timeline-grid,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .site-header {
    border-radius: 24px;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
  }

  .section {
    padding: 72px 0;
  }

  .hero__content h1 {
    font-size: 4.5rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }
}

/* Small phone layout: tighter spacing and full-width primary buttons. */
@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .section {
    padding: 56px 0;
  }

  .panel,
  .skill-card,
  .timeline-card,
  .project-card__content,
  .contact-panel,
  .terminal-card {
    padding: 20px;
  }

  .hero__content h1 {
    font-size: 2.65rem;
  }

  .project-card__meta,
  .project-spotlight__meta {
    display: grid;
  }

  .button {
    width: 100%;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .code-bg,
  .intro-loader {
    display: none;
  }
}

/* Fallback reveal state before JavaScript marks sections visible. */
.reveal{
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible{
    opacity: 1;
    transform: translateY(0);
}
