/* ===========================================================
   Roberto Isaac Consulting AB — site styles
   Editorial · calm · paper + ink + a single teal accent
   Light-first, with an opt-in dark theme.
   =========================================================== */
:root {
  --bg:          #f5f4f0;   /* warm paper */
  --bg-soft:     #edebe4;
  --surface:     #ffffff;   /* clean card on paper */
  --surface-2:   #faf9f6;
  --border:      rgba(24, 26, 30, 0.12);
  --border-hi:   rgba(24, 26, 30, 0.26);
  --text:        #191b1e;
  --text-dim:    #545861;
  --text-faint:  #8b8f97;
  --accent:      #0e5f56;   /* deep teal */
  --accent-ink:  #0b4a43;   /* darker teal for hover */
  --accent-soft: rgba(14, 95, 86, 0.09);
  --on-accent:   #f5f4f0;
  --shadow-sm:   0 1px 2px rgba(24, 26, 30, 0.05);
  --shadow:      0 14px 40px -24px rgba(24, 26, 30, 0.28);
  --radius:      12px;
  --maxw:        1000px;
  --font:        'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-head:   'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono:   'IBM Plex Mono', ui-monospace, monospace;
}

:root[data-theme="dark"] {
  --bg:          #15171b;
  --bg-soft:     #1b1e23;
  --surface:     #1c1f25;
  --surface-2:   #22262d;
  --border:      rgba(232, 236, 242, 0.13);
  --border-hi:   rgba(232, 236, 242, 0.26);
  --text:        #e8eaed;
  --text-dim:    #a4aab3;
  --text-faint:  #71767e;
  --accent:      #57bcac;   /* lighter teal for dark bg */
  --accent-ink:  #6fcbbb;
  --accent-soft: rgba(87, 188, 172, 0.14);
  --on-accent:   #10231f;
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:      0 20px 50px -26px rgba(0, 0, 0, 0.65);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--text); }
.accent { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }

section { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ===========================================================
   Nav
   =========================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 18px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--font-head); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand .dot { color: var(--accent); }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-dim);
  position: relative; transition: color 0.2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.22s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-dim); cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-toggle:hover { border-color: var(--border-hi); color: var(--text); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ===========================================================
   Buttons
   =========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 9px; font-weight: 500; font-size: 0.94rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.16s ease, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border-hi); color: var(--text); }
.btn-ghost:hover { background: var(--surface); border-color: var(--text); transform: translateY(-1px); }
.btn-lg { padding: 14px 30px; font-size: 1rem; }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  min-height: 82vh;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
  padding-top: 56px; padding-bottom: 64px;
}
.hero-inner { min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim);
  margin-bottom: 26px;
}
.status-dot {
  --dot: var(--accent);
  width: 8px; height: 8px; border-radius: 50%; background: var(--dot);
  animation: pulse 2.6s infinite;
}
.status-dot.busy { --dot: #d98a2b; }  /* amber — busy but reachable */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dot) 45%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title { font-size: clamp(3rem, 8vw, 5.4rem); font-weight: 500; letter-spacing: -0.02em; }
.hero-sub { font-family: var(--font-head); font-size: clamp(1.4rem, 3.2vw, 2rem); font-weight: 400; color: var(--text-dim); margin-top: 10px; }
.hero-lead { margin-top: 26px; font-size: 1.1rem; color: var(--text-dim); max-width: 600px; }

.hero-cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 16px 40px;
  margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--border);
}
.hero-meta dt {
  font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 3px;
}
.hero-meta dd { font-size: 0.94rem; font-weight: 500; color: var(--text); }

/* Terminal panel — fixed dark palette so it reads as a real terminal in both themes */
.hero-terminal {
  --t-bg: #17191e; --t-bar: #1f2229; --t-border: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--t-border); border-radius: 12px; overflow: hidden;
  background: var(--t-bg); box-shadow: var(--shadow);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: var(--t-bar); border-bottom: 1px solid var(--t-border);
}
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f56; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em {
  margin-left: auto; font-style: normal; font-family: var(--font-mono);
  font-size: 0.74rem; color: #7d828c;
}
.term-body {
  padding: 20px; margin: 0; font-family: var(--font-mono);
  font-size: 0.82rem; line-height: 1.95; color: #c3c8d0; white-space: pre-wrap;
}
.c-prompt { color: #5fd3c3; } .c-cmd { color: #e8eaed; }
.c-ok { color: #5cc98a; } .c-dim { color: #7d828c; }
.c-hi { color: #5cc98a; font-weight: 500; }
.blink { animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===========================================================
   Sections
   =========================================================== */
.section { padding-top: 84px; padding-bottom: 24px; }
.section-head {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 42px;
  padding-top: 26px; border-top: 1px solid var(--border);
}
.section-head.center { flex-direction: column; align-items: center; text-align: center; gap: 10px; border-top: none; padding-top: 0; }
.section-num { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); font-weight: 500; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 500; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-facts { list-style: none; margin-top: 26px; display: grid; gap: 13px; }
.about-facts li { display: flex; gap: 16px; font-size: 0.95rem; color: var(--text); }
.about-facts strong {
  min-width: 108px; color: var(--text-faint); font-family: var(--font-mono);
  font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; padding-top: 3px;
}
.about-card {
  padding: 8px 30px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.stat { padding: 22px 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: none; }
.stat-num { display: block; font-family: var(--font-head); font-weight: 500; font-size: 2.6rem; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--text-dim); margin-top: 6px; }

/* Timeline */
.timeline { position: relative; padding-left: 4px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1.5px;
  background: var(--border-hi);
}
.tl-item { position: relative; padding-left: 36px; padding-bottom: 30px; }
.tl-dot {
  position: absolute; left: 0; top: 7px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl-content {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 22px 24px; box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, transform 0.25s;
}
.tl-content:hover { border-color: var(--border-hi); transform: translateX(3px); }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tl-head h3 { font-size: 1.2rem; font-weight: 600; }
.tl-date { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-faint); white-space: nowrap; }
.tl-org { color: var(--accent); font-weight: 500; font-size: 0.9rem; margin: 5px 0 12px; }
.tl-content p { color: var(--text-dim); font-size: 0.96rem; }
.tl-content em { color: var(--text); font-style: normal; font-weight: 600; }

/* tags */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tags li {
  font-family: var(--font-mono); font-size: 0.74rem; padding: 4px 10px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}
:root[data-theme="dark"] .tags li { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-col {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 24px; box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, transform 0.25s;
}
.skill-col:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.skill-col h4 {
  font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); margin-bottom: 16px; font-weight: 500;
}
.skill-col ul { list-style: none; display: grid; gap: 9px; }
.skill-col li { font-size: 0.94rem; color: var(--text); padding-left: 16px; position: relative; }
.skill-col li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

/* Certifications */
.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cert {
  display: flex; align-items: center; gap: 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 20px 22px; box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, transform 0.25s;
}
.cert:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.cert-badge {
  display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 10px; font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  background: var(--accent); color: var(--on-accent);
}
.cert h4 { font-family: var(--font); font-size: 1rem; font-weight: 600; }
.cert p { font-size: 0.84rem; color: var(--text-faint); margin-top: 2px; }

/* Contact */
.contact { text-align: center; padding-bottom: 84px; }
.contact-lead { max-width: 560px; margin: 0 auto 38px; color: var(--text-dim); font-size: 1.06rem; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 640px; margin: 0 auto; }
.contact-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, transform 0.25s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.contact-icon { display: grid; place-items: center; color: var(--accent); }
.contact-icon svg { width: 24px; height: 24px; }
.contact-card strong { font-size: 0.94rem; font-weight: 600; }
.contact-card span { font-size: 0.82rem; color: var(--text-faint); word-break: break-word; }

/* Footer */
.footer {
  text-align: center; padding: 40px 28px; margin-top: 48px;
  border-top: 1px solid var(--border); color: var(--text-faint); font-size: 0.86rem;
}

/* ===========================================================
   Reveal on scroll (subtle, staggered)
   =========================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

.timeline .tl-item:nth-child(2) { transition-delay: 0.05s; }
.timeline .tl-item:nth-child(3) { transition-delay: 0.10s; }
.timeline .tl-item:nth-child(4) { transition-delay: 0.15s; }
.timeline .tl-item:nth-child(5) { transition-delay: 0.20s; }
.skills .skill-col:nth-child(2), .certs .cert:nth-child(2), .contact-grid .contact-card:nth-child(2) { transition-delay: 0.06s; }
.skills .skill-col:nth-child(3), .certs .cert:nth-child(3), .contact-grid .contact-card:nth-child(3) { transition-delay: 0.12s; }
.skills .skill-col:nth-child(4) { transition-delay: 0.18s; }
.skills .skill-col:nth-child(5) { transition-delay: 0.24s; }
.skills .skill-col:nth-child(6) { transition-delay: 0.30s; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .hero-terminal { order: 2; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .skills { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  .skills, .certs, .contact-grid, .hero-meta { grid-template-columns: 1fr; }
  .tl-head { flex-direction: column; gap: 3px; }
  .section { padding-top: 64px; }
}

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