/* =========================================================
   Luis Gonzalo Cañas Iniesta — personal site
   Design: "the editor, not the marketing site"
   Palette pulled from a real dark editor theme (GitHub Dark),
   because that's the actual world this content lives in.
   ========================================================= */

:root {
  /* Color tokens — GitHub Dark-inspired, not invented */
  --bg: #0d1117;
  --bg-raised: #11161d;
  --bg-inset: #161b22;
  --border: #21262d;
  --border-strong: #30363d;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --text-bright: #f0f6fc;
  --accent: #58a6ff;       /* link / focus blue */
  --accent-dim: #1f6feb;
  --green: #3fb950;        /* git-add green, used for "active/now" markers */
  --green-dim: #2ea043;
  --orange: #f78166;       /* warm accent for dates / highlights */
  --purple: #bc8cff;       /* secondary accent for keywords */

  /* Type */
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --content-w: 760px;
  --radius: 6px;
}

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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* subtle background texture: faint grid, like a code editor minimap area */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black, transparent 70%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

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

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

ul {
  padding-left: 1.2em;
}

h1, h2, h3, h4 {
  font-family: var(--font-mono);
  color: var(--text-bright);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1.1em;
  color: var(--text);
}

.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

.text-dim {
  color: var(--text-dim);
}

/* =================== NAV — styled like a browser/editor tab bar =================== */

.tabbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.tabbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabbar-inner::-webkit-scrollbar {
  display: none;
}

.tab-dots {
  display: flex;
  gap: 6px;
  padding-right: 12px;
  margin-right: 8px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.tab-dots span:nth-child(1) { background: #f85149; }
.tab-dots span:nth-child(2) { background: #d29922; }
.tab-dots span:nth-child(3) { background: #3fb950; }

.tab {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab:hover {
  color: var(--text-bright);
  background: var(--bg-inset);
}

.tab.is-active {
  color: var(--accent);
  background: var(--bg-inset);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* =================== HERO =================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 24px 60px;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}

.hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  object-fit: cover;
}

.hero-prompt {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--green);
  margin-bottom: 14px;
}

.hero-prompt .path {
  color: var(--accent);
}

.hero-name {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 6px;
}

.hero-name .light {
  color: var(--text-dim);
  font-weight: 400;
}

.hero-role {
  font-family: var(--font-mono);
  color: var(--purple);
  font-size: 18px;
  margin-bottom: 18px;
}

.hero-role .cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--purple);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-edu {
  font-size: 14px;
  color: var(--text-dim);
}

.scroll-cue {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

.scroll-cue a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.scroll-cue svg {
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* =================== SECTIONS =================== */

section {
  padding: 90px 0;
  border-top: 1px solid var(--border);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  margin-bottom: 8px;
}

.section-tag::before {
  content: "// ";
  color: var(--text-dim);
}

section h2 {
  font-size: 28px;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

section h2 .num {
  font-size: 16px;
  color: var(--text-dim);
  font-weight: 400;
}

/* =================== ABOUT =================== */

.skill-block {
  margin-bottom: 28px;
}

.skill-block p {
  margin-bottom: 14px;
}

.tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.tech-chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* =================== WORK — git log timeline =================== */

.timeline {
  position: relative;
  border-left: 2px solid var(--border-strong);
  margin-left: 6px;
  padding-left: 32px;
}

.commit {
  position: relative;
  margin-bottom: 52px;
}

.commit:last-child {
  margin-bottom: 0;
}

.commit::before {
  content: "";
  position: absolute;
  left: -39px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.commit.is-current::before {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.2);
}

.commit-head {
  margin-bottom: 6px;
}

.commit-role {
  font-size: 17px;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-weight: 600;
}

.commit-role .at {
  color: var(--text-dim);
  font-weight: 400;
}

.commit-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--orange);
  margin: 4px 0 10px;
}

.commit-body p {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.commit-body img,
.commit-body .video-wrap {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
}

.commit-body .img-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 540px) {
  .commit-body .img-row {
    grid-template-columns: 1fr;
  }
}

/* =================== VALUE — diff-style list =================== */

.diff-list {
  list-style: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 14.5px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.diff-list li {
  padding: 9px 16px 9px 40px;
  position: relative;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.diff-list li:last-child {
  border-bottom: none;
}

.diff-list li::before {
  content: "+";
  position: absolute;
  left: 16px;
  color: var(--green);
  font-weight: 700;
}

/* =================== REFERENCES =================== */

.quote-grid {
  display: grid;
  gap: 20px;
}

blockquote {
  margin: 0;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
}

blockquote p {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
  font-style: normal;
}

blockquote footer {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

blockquote footer strong {
  color: var(--text-bright);
}

/* =================== CONTACT =================== */

.contact-card {
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  font-family: var(--font-mono);
}

.contact-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  margin-bottom: 10px;
}

.contact-line:last-child {
  margin-bottom: 0;
}

.contact-line .key {
  color: var(--purple);
}

.contact-line .colon {
  color: var(--text-dim);
}

/* =================== BUTTONS =================== */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-bright);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  background: var(--bg-raised);
}

.btn-primary {
  border-color: var(--green-dim);
  color: var(--green);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  border-color: var(--green);
  color: var(--green);
  background: rgba(63, 185, 80, 0.08);
}

/* =================== STORY (collapsible) =================== */

.story-toggle {
  width: 100%;
  text-align: left;
}

.story-toggle summary {
  cursor: pointer;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.story-toggle summary::-webkit-details-marker {
  display: none;
}

.story-toggle summary .chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.story-toggle[open] summary .chevron {
  transform: rotate(90deg);
}

.story-content {
  padding-top: 18px;
}

/* =================== MODALS =================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 9, 0.7);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-raised);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--text-bright);
}

.modal-body {
  padding: 20px 22px 26px;
  font-size: 14.5px;
}

.modal-body ul {
  margin: 0 0 14px;
}

.modal-body > ul {
  padding-left: 0;
  list-style: none;
}

.modal-body > ul > li {
  margin-bottom: 14px;
}

.modal-body ul ul {
  margin-top: 6px;
  padding-left: 18px;
  list-style: disc;
  color: var(--text-dim);
}

.modal-body strong {
  color: var(--text-bright);
}

/* =================== FOOTER =================== */

footer.site-footer {
  padding: 40px 0 60px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-dim);
}

.footer-social a:hover,
.footer-social a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* =================== RESPONSIVE =================== */

@media (max-width: 600px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  section {
    padding: 64px 0;
  }

  .hero {
    padding-top: 84px;
  }
}

/* lite-youtube override to fit dark theme container */
lite-youtube {
  max-width: 100%;
  background-color: var(--bg-inset);
}
