/* ==========================================================
   Roys YB — Infrastructure & DevOps Engineer Portfolio
   style.css
   ----------------------------------------------------------
   1. Design Tokens        5. Buttons & Tags         9. Terminal
   2. Reset & Base         6. Hero                   10. Certifications
   3. Layout Utilities     7. About / Timeline        11. Contact / Footer
   4. Navigation           8. Skills / Projects       12. Media Queries
========================================================== */

/* ==========================================================
   1. DESIGN TOKENS
   Palette avoids the two AI-portfolio defaults (warm-cream/
   terracotta, near-black/acid-green). Base is a cool graphite-
   navy; the brand accent is a restrained signal blue used only
   for interactive/primary moments. Terminal green is scoped
   ONLY to the terminal component — it's a system color, not a
   site-wide accent, so it stays meaningful instead of decorative.
========================================================== */

:root {
  /* Surfaces */
  --bg: #0a0d12;
  --bg-elevated: #10141b;
  --surface: #131820;
  --surface-hover: #171d27;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);

  /* Text */
  --text-primary: #e8edf4;
  --text-secondary: #9aa7b8;
  --text-muted: #5b6675;

  /* Brand accent — used sparingly: links, focus, primary CTA */
  --accent: #5b8cff;
  --accent-dim: #5b8cff1a;
  --accent-strong: #7ba3ff;

  /* System colors — scoped to terminal + status only */
  --term-green: #3fe08f;
  --term-amber: #f5a623;
  --term-red: #f85149;
  --term-cyan: #56d4dd;

  /* Type */
  --font-display: "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  /* Scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-height: 72px;
}

/* ==========================================================
   2. RESET & BASE
========================================================== */

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(91, 140, 255, 0.08), transparent);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul { list-style: none; }

button, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

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

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ==========================================================
   3. LAYOUT UTILITIES
========================================================== */

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

section { padding-block: var(--space-6); }

.section-header {
  max-width: 640px;
  margin-bottom: var(--space-4);
}

.section-header span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}

.section-header span::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.section-header h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
}

.section-header p {
  margin-top: var(--space-1);
  color: var(--text-secondary);
  max-width: 56ch;
}

/* Reveal-on-scroll (JS toggles .show) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.show { opacity: 1; transform: translateY(0); }

/* ==========================================================
   4. NAVIGATION
========================================================== */

.header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(10, 13, 18, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.header.scrolled {
  background: rgba(10, 13, 18, 0.92);
  border-bottom-color: var(--border-strong);
}

.navbar { display: flex; align-items: center; justify-content: space-between; }

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.92rem;
}

.nav-links a {
  position: relative;
  color: var(--text-secondary);
  padding-block: 0.3rem;
  transition: color 0.2s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.menu-toggle {
  display: none;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 110;
}

/* ==========================================================
   5. BUTTONS & TAGS
========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #06090f;
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--accent); }

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

/* ==========================================================
   6. HERO
========================================================== */

.hero {
  padding-top: calc(var(--header-height) + var(--space-5));
  padding-bottom: var(--space-5);
}

.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-4);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--term-green);
  background: rgba(63, 224, 143, 0.08);
  border: 1px solid rgba(63, 224, 143, 0.25);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}
.hero-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--term-green);
  box-shadow: 0 0 8px var(--term-green);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  margin-bottom: 0.3rem;
}

.hero h2 {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--accent-strong);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.hero-description {
  color: var(--text-secondary);
  max-width: 54ch;
  margin-bottom: var(--space-3);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
}
.hero-tags span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: var(--space-4);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  max-width: 480px;
}

.stat-card {
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.stat-card h3 {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent-strong);
}
.stat-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.hero-image { position: relative; }

.image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 1 / 1;
  background: var(--surface);
}

.image-wrapper img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.image-wrapper:hover img { transform: scale(1.03); }

/* ==========================================================
   7. ABOUT / TIMELINE
========================================================== */

.about-grid, .skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.about-card, .skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.about-card:hover, .skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.about-card h3, .skill-card h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.about-card p { color: var(--text-secondary); font-size: 0.95rem; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tags span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
}

.timeline { position: relative; padding-left: var(--space-4); }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item { position: relative; padding-bottom: var(--space-4); }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-4) + 1px);
  top: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-strong);
  margin-bottom: 0.3rem;
}

.timeline-content h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.timeline-content p { color: var(--text-secondary); font-size: 0.95rem; max-width: 62ch; }

/* ==========================================================
   8. PROJECTS
========================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.project-card .project-media {
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
}
.project-card .project-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.project-card:hover .project-media img { transform: scale(1.05); }

.project-content { padding: var(--space-3); display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.project-content h3 { font-size: 1.05rem; }
.project-content p { color: var(--text-secondary); font-size: 0.9rem; flex: 1; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-strong);
  background: var(--accent-dim);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
}

.project-links { display: flex; gap: var(--space-2); margin-top: 0.3rem; }
.project-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.project-links a:hover { color: var(--accent-strong); border-color: var(--accent); }

.project-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
}
.project-status[data-status="live"] { color: var(--term-green); background: rgba(63,224,143,0.08); }
.project-status[data-status="planned"] { color: var(--term-amber); background: rgba(245,166,35,0.08); }

/* ==========================================================
   9. TERMINAL
========================================================== */

.terminal-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.7rem var(--space-2);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.terminal-buttons { display: flex; gap: 0.45rem; }
.terminal-buttons span { width: 11px; height: 11px; border-radius: 50%; }
.terminal-buttons .red { background: #ff5f57; }
.terminal-buttons .yellow { background: #febc2e; }
.terminal-buttons .green { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-body {
  height: 400px;
  overflow-y: auto;
  padding: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.87rem;
  line-height: 1.65;
}
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.terminal-line { white-space: pre-wrap; word-break: break-word; }
.terminal-line .prompt-tag { color: var(--term-green); }
.terminal-line .path-tag { color: var(--term-cyan); }
.terminal-line.command { color: var(--text-primary); }
.terminal-line.output { color: var(--text-secondary); }
.terminal-line.error { color: var(--term-red); }
.terminal-line.success { color: var(--term-green); }
.terminal-line.warning { color: var(--term-amber); }
.terminal-line.heading { color: var(--accent-strong); font-weight: 600; }

.terminal-input-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem var(--space-2);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.87rem;
}
.terminal-input-area .prompt { color: var(--term-green); white-space: nowrap; }

#terminal-input {
  flex: 1;
  color: var(--text-primary);
  caret-color: var(--term-green);
}

.terminal-help {
  margin-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.terminal-help code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* ==========================================================
   10. CERTIFICATIONS
========================================================== */

.certification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2);
}

.certification-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  transition: border-color 0.25s var(--ease);
}
.certification-card:hover { border-color: var(--border-strong); }
.certification-card h3 { font-size: 0.98rem; }

.cert-complete, .cert-progress {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cert-complete { color: var(--term-green); background: rgba(63,224,143,0.08); }
.cert-progress { color: var(--term-amber); background: rgba(245,166,35,0.08); }

/* ==========================================================
   11. CONTACT / FOOTER
========================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.contact-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.contact-card h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.contact-card p { color: var(--text-secondary); font-size: 0.9rem; }

.footer { padding-block: var(--space-4); border-top: 1px solid var(--border); }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }
.footer-logo { font-family: var(--font-mono); font-weight: 600; }
.footer-content p { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links { display: flex; gap: var(--space-2); }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--accent-strong); }
.copyright { font-size: 0.78rem; color: var(--text-muted); }

/* ==========================================================
   12. MEDIA QUERIES
========================================================== */

@media (max-width: 1024px) {
  .hero-container { grid-template-columns: 1fr; }
  .hero-image { max-width: 380px; margin-inline: auto; order: -1; }
  .about-grid, .skills-grid, .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: var(--header-height) 0 auto auto;
    flex-direction: column;
    align-items: stretch;
    width: min(78vw, 320px);
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: var(--space-2);
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
  }
  .nav-links.active { transform: translateX(0); }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 0.9rem 0.4rem; }
}

@media (max-width: 640px) {
  section { padding-block: var(--space-5); }
  .about-grid, .skills-grid, .contact-grid, .hero-stats { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .terminal-body { height: 320px; }
}
