/* ==========================================================================
   Raymond B. Cebricus — Portfolio
   ========================================================================== */

:root {
  /* Dark is the default theme */
  --primary: #8ab8ff;
  --accent: #4da6ff;
  --bg: #0d1320;
  --bg-alt: #121a2b;
  --surface: #172136;
  --text: #e6ecf5;
  --muted: #9aa7bd;
  --border: #253150;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --header-h: 68px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --primary: #0b3d91;
  --accent: #1f8fff;
  --bg: #ffffff;
  --bg-alt: #f4f7fc;
  --surface: #ffffff;
  --text: #1b2333;
  --muted: #5b6678;
  --border: #e1e7f0;
  --shadow: 0 10px 30px -12px rgba(11, 61, 145, 0.18);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 1.25rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; }

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

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px -12px rgba(0,0,0,.2); }

.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }

.nav-menu { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-menu a {
  display: block; padding: .5rem .8rem; border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: .95rem;
}
.nav-menu a:hover, .nav-menu a.is-active { color: var(--accent); background: var(--bg-alt); text-decoration: none; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; margin-left: .5rem;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--text); transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 600; border: 2px solid transparent; transition: transform .15s, background .2s, color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--accent); color: var(--accent); }
.btn-light { background: #fff; color: #0b3d91; }
.btn-social { display: inline-flex; align-items: center; gap: .6rem; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem);
  background: url("../images/pattern.svg"), linear-gradient(180deg, var(--bg-alt), var(--bg));
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 1rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; }
.accent { color: var(--primary); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 2.25rem; }

.stats { display: flex; flex-wrap: wrap; gap: 2rem; list-style: none; padding: 0; margin: 0; }
.stats strong { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.stats span { font-size: .9rem; color: var(--muted); }

.hero-art img { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; margin-bottom: 2rem; position: relative; padding-bottom: .6rem;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* About */
.about-grid { display: grid; grid-template-columns: 220px 1fr; gap: 3rem; align-items: center; }
.avatar { border-radius: 50%; aspect-ratio: 1; object-fit: cover; box-shadow: var(--shadow); border: 4px solid var(--surface); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.tags li { padding: .35rem .85rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); font-size: .88rem; font-weight: 600; color: var(--primary); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card img { margin-bottom: 1rem; }
.card h3 { font-size: 1.1rem; }
.card p { margin: .25rem 0; }
.muted { color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .75rem 0 0; }
.chips li { font-size: .82rem; padding: .25rem .65rem; border-radius: 6px; background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); }
.small-list { padding-left: 1.1rem; margin: .75rem 0 0; font-size: .9rem; color: var(--muted); }
.speaking { margin-top: 1.25rem; }

.badge {
  display: inline-block; margin-bottom: .75rem; padding: .2rem .7rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
}
.badge-gold { background: rgba(240, 173, 0, .15); color: #b07d00; }
.badge-green { background: rgba(6, 214, 160, .15); color: #04936e; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 180px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { display: grid; grid-template-columns: 180px 1fr; gap: 2.5rem; padding-bottom: 2.5rem; position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: 174px; top: .4rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent);
}
.timeline-meta { text-align: right; padding-right: .5rem; }
.timeline-meta .date { display: block; font-weight: 700; color: var(--primary); }
.timeline-meta .duration { font-size: .85rem; color: var(--muted); }
.timeline-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.timeline-body h3 { font-size: 1.2rem; margin-bottom: .15rem; }
.role-sub { margin: 0; color: var(--muted); font-style: italic; }
.org { margin: .25rem 0 .75rem; font-weight: 600; color: var(--accent); font-size: .95rem; }
.timeline-body ul { padding-left: 1.2rem; margin: .5rem 0 0; }
.timeline-body li { margin-bottom: .35rem; }

/* Training */
.filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-btn {
  font: inherit; font-size: .9rem; font-weight: 600; padding: .45rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.filter-btn.is-active, .filter-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.training-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.training {
  border-left: 4px solid var(--accent); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.1rem 1.25rem;
}
.training .date { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.training h3 { font-size: 1.02rem; margin: .3rem 0 .15rem; }
.training .org { margin: 0 0 .4rem; font-size: .85rem; }
.training p:last-child { margin: 0; font-size: .92rem; color: var(--muted); }

/* Contact */
.contact { background: linear-gradient(135deg, #0b3d91, #1f8fff); color: #fff; text-align: center; }
.contact .section-title::after { left: 50%; transform: translateX(-50%); background: #fff; }
.contact-links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.contact .lead { color: #dbe9ff; margin: 0 auto 2rem; }

/* Footer */
.site-footer { padding-block: 1.5rem; border-top: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.site-footer p { margin: 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
[hidden] { display: none !important; }

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: .75rem 1.25rem 1.25rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { padding: .75rem .5rem; }
  .theme-toggle { margin: .5rem 0 0; }

  .about-grid { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .about-grid .avatar { width: 160px; margin: 0 auto; }
  .about-grid .section-title::after { left: 50%; transform: translateX(-50%); }
  .tags { justify-content: center; }

  .timeline::before { left: 6px; }
  .timeline-item { grid-template-columns: 1fr; gap: .5rem; padding-left: 2rem; }
  .timeline-item::before { left: 0; }
  .timeline-meta { text-align: left; padding: 0; }
  .timeline-meta .date { display: inline; margin-right: .5rem; }
}

/* 404 page */
.not-found { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.not-found h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
.not-found .lead { margin: 0 auto 2rem; }
