/* ============================================================
   Portfolio — Andy Faniry Ramaroson
   Static site, no build step. Works on any host.
   ============================================================ */

:root {
  --bg: #0b0f16;
  --bg-alt: #0f141d;
  --surface: #141a25;
  --surface-2: #1a2130;
  --border: #232c3d;
  --text: #e6ebf4;
  --text-dim: #9aa7bd;
  --text-faint: #6b7a94;
  --accent: #4f9cf9;
  --accent-soft: rgba(79, 156, 249, 0.12);
  --accent-2: #38d39f;
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --border: #e2e8f0;
  --text: #10161f;
  --text-dim: #4a5768;
  --text-faint: #7b8798;
  --accent: #1d6fd4;
  --accent-soft: rgba(29, 111, 212, 0.09);
  --accent-2: #0f9d76;
  --shadow: 0 1px 2px rgba(16,22,31,.06), 0 8px 24px rgba(16,22,31,.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 200;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }

.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 8px;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 12px; letter-spacing: .04em;
}

.brand-name {
  font-weight: 650; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { display: flex; gap: 24px; }
.nav a {
  font-size: 14px; color: var(--text-dim); font-weight: 500;
  transition: color .15s ease;
}
.nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.lang-toggle {
  display: flex; align-items: center; gap: 3px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px; padding: 5px 12px;
  font: 600 12px/1 'Inter', sans-serif; cursor: pointer;
  transition: border-color .15s ease;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-toggle .lang-active { color: var(--accent); }
.lang-toggle .lang-sep { color: var(--text-faint); font-weight: 400; }

.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-dim); cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- Hero ---------------- */

.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(900px 420px at 12% -8%, var(--accent-soft), transparent 65%),
    radial-gradient(700px 340px at 92% 6%, rgba(56, 211, 159, .07), transparent 60%);
}

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

.hero-content { min-width: 0; }

.hero-photo-wrap {
  margin: 0;
  justify-self: end;
}

.hero-photo {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 550; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent);
}

.hero-title {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-role {
  font-size: clamp(15px, 2.2vw, 18px);
  font-weight: 600; color: var(--accent);
  margin-bottom: 18px;
}

.hero-pitch {
  max-width: 660px;
  font-size: 16.5px; color: var(--text-dim);
  margin-bottom: 26px;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin-bottom: 30px;
}
.meta-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; color: var(--text-faint);
}
.meta-item svg { flex: 0 0 auto; color: var(--accent); opacity: .8; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 48px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-ghost {
  background: var(--surface); border-color: var(--border); color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}
.stats li { display: flex; flex-direction: column; gap: 2px; }
.stats strong {
  font-size: clamp(21px, 3vw, 27px); font-weight: 800; color: var(--text);
  letter-spacing: -0.02em;
}
.stats span { font-size: 13px; color: var(--text-faint); line-height: 1.4; }

/* ---------------- Sections ---------------- */

.section { padding: 76px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { margin-bottom: 38px; max-width: 660px; }
.section-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(24px, 3.6vw, 32px); font-weight: 750; }
.section-sub { margin-top: 12px; color: var(--text-dim); font-size: 15.5px; }

.grid { display: grid; gap: 18px; }
.projects-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.skills-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.two-col { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.edu-grid { margin-top: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .18s ease, transform .18s ease;
}

/* ---------------- Projects ---------------- */

.project { display: flex; flex-direction: column; }
.project:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); }

.project-top { margin-bottom: 16px; }
.project-top h3 { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.project-top h3 span { color: var(--text-dim); font-weight: 500; }

.badge {
  display: inline-block;
  font: 500 11.5px/1 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 9px; border-radius: 6px;
}

.ors { margin-bottom: 16px; }
.ors dt {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  margin-top: 12px;
}
.ors dt:first-child { margin-top: 0; }
.ors dd { font-size: 14.5px; color: var(--text-dim); margin-top: 3px; }

.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.stack li {
  font: 500 11.5px/1 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 9px; border-radius: 6px;
}

.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px;
  font-size: 13.5px; font-weight: 600; color: var(--accent);
}
.project-link:hover { text-decoration: underline; }

/* ---------------- Timeline ---------------- */

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.timeline > li { position: relative; padding-bottom: 34px; }
.timeline > li:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute; left: -26px; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
}

.tl-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  margin-bottom: 3px;
}
.tl-head h3 { font-size: 16.5px; font-weight: 700; }
.tl-date {
  font: 500 12px/1 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-faint);
}
.tl-org { font-size: 14px; color: var(--accent); font-weight: 550; margin-bottom: 10px; }

.tl-body ul { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tl-body ul li {
  position: relative; padding-left: 16px;
  font-size: 14.5px; color: var(--text-dim);
}
.tl-body ul li::before {
  content: ''; position: absolute; left: 2px; top: 10px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint);
}

.tl-stack {
  font: 500 12.5px/1.6 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-faint);
}
.tl-stack span { color: var(--accent); }

/* ---------------- Skills ---------------- */

.skill-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-size: 12.5px; font-weight: 500;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 11px; border-radius: 999px;
}

.plain { display: flex; flex-direction: column; gap: 10px; }
.plain li { font-size: 14.5px; color: var(--text-dim); }
.plain strong { color: var(--text); font-weight: 650; }
.edu-grid h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }

/* ---------------- Contact ---------------- */

.contact-box { text-align: center; max-width: 620px; margin: 0 auto; }
.contact-box h2 { font-size: clamp(24px, 3.6vw, 32px); font-weight: 750; margin-bottom: 14px; }
.contact-box > p { color: var(--text-dim); font-size: 16px; margin-bottom: 28px; }

.contact-links { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 550; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 999px;
  transition: border-color .15s ease, color .15s ease;
}
.contact-links a:hover { border-color: var(--accent); color: var(--accent); }
.contact-links svg { color: var(--accent); flex: 0 0 auto; }

/* ---------------- Footer ---------------- */

.site-footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  justify-content: space-between;
  font-size: 13.5px; color: var(--text-faint);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 820px) {
  .nav { display: none; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-photo-wrap {
    order: -1;
    justify-self: center;
  }
  .hero-photo { max-width: 200px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 60px 0 56px; }
  .section { padding: 58px 0; }
}

@media (max-width: 460px) {
  .brand-name { display: none; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-links a { width: 100%; justify-content: center; }
}

/* ---------------- Print (PDF export) ---------------- */

@media print {
  .site-header, .hero-cta, .contact-links, #theme-toggle, #lang-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .section-alt { background: #fff; border-color: #ccc; }
  .section { padding: 18px 0; }
  a { color: #000; }
}
