/* =====================================================================
   Felix Travieso — Personal Site
   Terraform-themed dark aesthetic
   ===================================================================== */

:root {
  --bg:          #0d1117;
  --bg-2:        #161b22;
  --bg-3:        #1c2128;
  --border:      #30363d;
  --border-soft: #21262d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-dim:    #656d76;

  --green:       #3fb950;
  --yellow:      #d29922;
  --amber:       #e3b341;
  --red:         #f85149;
  --blue:        #58a6ff;
  --cyan:        #39d353;
  --purple:      #bc8cff;

  /* Terraform brand */
  --tf-purple:   #7c3aed;
  --tf-accent:   #a78bfa;
  --tf-accent-2: #8b5cf6;

  --font:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --max-w:       1100px;
  --radius:      10px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* =====================================================================
   NAV
   ===================================================================== */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  background: rgba(13,17,23,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.site-nav.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--tf-accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.tf-logo {
  width: 18px;
  height: 20px;
  color: var(--tf-accent);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--tf-purple) !important;
  color: #fff !important;
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  font-size: 0.78rem !important;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: #6d28d9 !important; }

/* =====================================================================
   TERMINAL
   ===================================================================== */
#terminal-container {
  padding: 5rem 2rem 3rem; /* top clears the fixed nav bar */
  display: flex;
  justify-content: center;
}

#terminal-window {
  width: 100%;
  max-width: var(--max-w);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 24px rgba(0,0,0,0.4),
    0 24px 64px rgba(0,0,0,0.3);
}

/* --- Titlebar --- */
#terminal-titlebar {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  user-select: none;
  gap: 0.8rem;
}

.wc { display: flex; gap: 6px; }
.wc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wc-close  { background: #ff5f56; }
.wc-min    { background: #ffbd2e; }
.wc-max    { background: #27c93f; }

.wc-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

.replay-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.replay-btn:hover { color: var(--text-muted); border-color: var(--text-dim); }
.replay-btn.hidden { visibility: hidden; pointer-events: none; }

/* --- Terminal body --- */
#terminal-body {
  padding: 1.2rem 1.5rem 1.4rem;
  max-height: 540px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#terminal-body::-webkit-scrollbar { width: 6px; }
#terminal-body::-webkit-scrollbar-track { background: transparent; }
#terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

#terminal-lines { display: flex; flex-direction: column; }

/* =====================================================================
   TERMINAL LINE TYPES
   ===================================================================== */
.t-line {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.65em;
}
.t-line.blank { min-height: 0.7em; }

/* $ command prompt */
.t-line.cmd { color: var(--green); }
.t-line.cmd::before {
  content: '$ ';
  color: var(--tf-accent);
  font-weight: 600;
}

.t-line.info    { color: var(--text-muted); }
.t-line.success { color: var(--green); }
.t-line.add     { color: var(--green); }
.t-line.comment { color: var(--text-dim); font-style: italic; }

.t-line.plan-summary {
  color: var(--green);
  font-weight: 600;
}

.t-line.prompt-line { color: var(--text-muted); }
.t-line.prompt-line .typed-yes { color: var(--green); }

.t-line.apply-start { color: var(--amber); }
.t-line.apply-done  { color: var(--green); }

.t-line.apply-banner {
  color: var(--green);
  font-weight: 700;
}

.t-line.out-header { color: var(--tf-accent); font-weight: 600; }
.t-line.out-val-tf {
  color: var(--amber);
  padding-left: 0.5rem;
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--green);
  vertical-align: middle;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* =====================================================================
   RESUME MAIN LAYOUT
   ===================================================================== */
#resume-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 8rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* =====================================================================
   TF-SECTION (base card)
   ===================================================================== */
.tf-section {
  display: none;        /* hidden until JS reveals */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  scroll-margin-top: 72px; /* clearance for sticky nav */
}
.tf-section.visible  { display: block; }
.tf-section.revealed { opacity: 1; transform: translateY(0); }

.tf-section-inner {
  padding: 1.8rem 2rem;
}

/* Resource declaration header / footer */
.resource-label {
  font-size: 0.82rem;
  margin-bottom: 1.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}
.resource-close {
  margin-top: 1.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.82rem;
}
.kw    { color: var(--tf-accent); }
.str   { color: var(--amber); }
.punct { color: var(--text-dim); }

.section-heading {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 1.4rem;
}

/* =====================================================================
   SUMMARY SECTION
   ===================================================================== */
.summary-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.profile-name {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.profile-role {
  color: var(--tf-accent);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.profile-location {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* Tech tags — sit below summary bullets in the right column */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}
.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.22rem 0.6rem;
  white-space: nowrap;
}
.tech-tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blue);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}
.contact-links a:hover { color: var(--text); }
.contact-links a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.summary-right p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.75;
  margin-bottom: 0.9rem;
}
.summary-right p:last-child { margin-bottom: 0; }

/* =====================================================================
   EXPERIENCE SECTION
   ===================================================================== */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.job-card {
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 1.3rem 1.5rem 1.3rem 1.8rem;
  position: relative;
}
/* Green "+" badge on card corner — Terraform resource create symbol */
.job-card::before {
  content: '+';
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  background: var(--green);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 6px 0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.job-company {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.job-role {
  font-size: 0.82rem;
  color: var(--tf-accent);
}
.job-meta {
  text-align: right;
  flex-shrink: 0;
}
.job-period {
  display: block;
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 0.1rem;
}
.job-location {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.job-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.job-bullets li {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.68;
  padding-left: 1.3rem;
  position: relative;
}
.job-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--tf-accent-2);
  font-size: 0.72rem;
  top: 0.18em;
}

/* =====================================================================
   EDUCATION SECTION
   ===================================================================== */
.edu-card {
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 1.3rem 1.5rem 1.3rem 1.8rem;
  position: relative;
}
.edu-card::before {
  content: '+';
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  background: var(--green);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 6px 0;
}
.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.edu-school {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.edu-degree {
  font-size: 0.82rem;
  color: var(--tf-accent);
}
.edu-minor {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.edu-meta { text-align: right; flex-shrink: 0; }
.edu-period {
  display: block;
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 0.1rem;
}
.edu-location { font-size: 0.72rem; color: var(--text-dim); }

/* =====================================================================
   SKILLS SECTION
   ===================================================================== */
.skills-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 2.5rem;
}

.skills-category { display: flex; flex-direction: column; gap: 0.7rem; }

.skills-cat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--tf-accent);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 0.2rem;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-pill {
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.22rem 0.65rem;
  border-radius: 5px;
  white-space: nowrap;
}

/* Reuse existing badge colour classes */
.badge-expert       { background: rgba(63,185,80,0.12);   color: var(--green);      border: 1px solid rgba(63,185,80,0.28); }
.badge-advanced     { background: rgba(88,166,255,0.12);   color: var(--blue);       border: 1px solid rgba(88,166,255,0.28); }
.badge-proficient   { background: rgba(210,153,34,0.12);   color: var(--amber);      border: 1px solid rgba(210,153,34,0.28); }
.badge-intermediate { background: rgba(139,148,158,0.12);  color: var(--text-muted); border: 1px solid rgba(139,148,158,0.28); }

/* =====================================================================
   OUTPUT SECTION
   ===================================================================== */
.output-section {
  border-color: rgba(124,58,237,0.4);
  background: linear-gradient(135deg, rgba(124,58,237,0.06) 0%, var(--bg-2) 60%);
}
.output-label { border-bottom-color: rgba(124,58,237,0.25); }
.kw-output {
  color: var(--tf-accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.output-body { padding: 0.4rem 0 0; }

.output-line {
  font-size: 0.88rem;
  margin-bottom: 1.4rem;
}
.out-key { color: var(--green); }
.out-eq  { color: var(--text-dim); }
.out-val {
  color: var(--amber);
  text-decoration: none;
  font-style: italic;
  transition: color 0.2s;
}
.out-val:hover { color: var(--text); text-decoration: underline; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--tf-purple);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: 7px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}
.download-btn:hover {
  background: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 860px) {
  .skills-body {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  #terminal-container { padding: 4rem 1rem 2rem; }
  #terminal-body { max-height: 420px; padding: 1rem; }
  #resume-main { padding: 0 1rem 5rem; }
  .tf-section-inner { padding: 1.2rem 1.2rem; }

  .summary-layout { grid-template-columns: 1fr; gap: 1.4rem; }
  .profile-name { font-size: 1.5rem; }

  .job-header { flex-direction: column; gap: 0.4rem; }
  .job-meta   { text-align: left; }
  .edu-header { flex-direction: column; gap: 0.4rem; }
  .edu-meta   { text-align: left; }

  .skill-row { gap: 0.5rem; }

  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links { gap: 0.75rem; }
}
