/* ---- Design tokens ---- */
:root {
  --bg: #23252f;
  --bg-panel: #34374a;
  --bg-panel-alt: #2b2e3d;
  --bg-alt: #1c1e27;
  --text: #f2f3f7;
  --muted: #a6acbb;
  --accent: #f2b134;
  --accent-dark: #d99a1f;
  --accent-ink: #2a2110;
  --border: rgba(255, 255, 255, 0.09);
  --radius: 14px;
  --max: 1160px;
  --space: clamp(3rem, 6vw, 5.5rem);
  --font-head: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }

img { max-width: 100%; height: auto; }

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}
.container--narrow { max-width: 620px; }

/* ---- Accessibility helpers ---- */
.skip-link {
  position: absolute; left: 0; top: -3rem;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; z-index: 100;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

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

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  width: min(100% - 2.5rem, var(--max)); margin-inline: auto;
  padding: .9rem 0;
}
.nav__brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; color: var(--text);
}
.nav__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-head); font-weight: 800; font-size: .8rem;
  letter-spacing: .01em;
}
.nav__menu {
  display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0;
}
.nav__menu a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav__menu a:hover { color: var(--accent); }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: .4rem;
}
.nav__toggle span {
  width: 24px; height: 2px; background: var(--text); border-radius: 2px;
}

@media (max-width: 640px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: .5rem 1.25rem 1rem;
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu li { padding: .5rem 0; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: .8rem 1.5rem;
  border-radius: 999px; font-weight: 600; font-family: var(--font-head);
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn--ghost { border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Hero ---- */
.hero { padding: var(--space) 0 calc(var(--space) * .6); background: var(--bg); }
.hero__grid {
  width: min(100% - 2.5rem, var(--max)); margin-inline: auto;
  display: grid; gap: 2.5rem; grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 860px) {
  .hero__grid { grid-template-columns: minmax(0, 320px) 1fr; gap: 4rem; }
}

.hero__visual {
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-panel-alt));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem;
  position: relative; overflow: hidden;
}
.hero__visual::before {
  content: ""; position: absolute; inset: auto -30% -40% auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.hero__avatar {
  position: relative;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 2rem;
  border: 4px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.hero__nameplate {
  position: relative;
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2rem); margin: 0;
}
.hero__nameplate-accent { color: var(--accent); }
.hero__iconlinks {
  position: relative;
  list-style: none; display: flex; gap: .75rem; margin: 0; padding: 0;
}
.hero__iconlinks a {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, color .15s, background .15s;
}
.hero__iconlinks a:hover {
  border-color: var(--accent); color: var(--accent-ink); background: var(--accent);
}

.hero__content { max-width: 640px; }
.hero__kicker {
  text-transform: uppercase; letter-spacing: .12em;
  font-size: .8rem; color: var(--accent); font-weight: 700; margin-bottom: 1rem;
}
.hero__title { font-size: clamp(2rem, 4.5vw, 2.9rem); }
.hero__lead { font-size: 1.15rem; color: var(--muted); max-width: 48ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; }

/* ---- Sections (general) ---- */
.section { padding: var(--space) 0; }
.section--alt { background: var(--bg-alt); }
.section__title { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.section__kicker {
  text-transform: uppercase; letter-spacing: .12em;
  font-size: .75rem; font-weight: 700; color: var(--accent);
  margin: 0 0 .5rem;
}
.section__intro { color: var(--muted); max-width: 60ch; margin-bottom: 2.5rem; }

/* ---- Stats strip ---- */
.stats { padding: var(--space) 0; background: var(--bg-alt); border-block: 1px solid var(--border); }
.stats__grid {
  display: grid; gap: 3rem; grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .stats__grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
.stats__title { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.stats__text { color: var(--muted); max-width: 42ch; }
.stats__link {
  display: inline-block; font-weight: 600; text-decoration: none;
  color: var(--accent); margin-top: .5rem;
}
.stats__link:hover { text-decoration: underline; }
.stats__quote {
  font-family: var(--font-head); font-weight: 600; font-size: 1.2rem;
  color: var(--text); font-style: normal; margin-bottom: 2rem;
}
.stats__numbers {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.stat__value {
  display: block; font-family: var(--font-head); font-weight: 800;
  font-size: 2.2rem; color: var(--accent);
}
.stat__label { display: block; color: var(--muted); font-size: .9rem; }

/* ---- Services / cards ---- */
.services { padding: var(--space) 0; background: var(--bg); }
.service-cards {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 2.5rem;
}
.service-card {
  background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  transition: transform .15s, border-color .15s;
}
.service-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.service-card h3 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
.service-card p { color: var(--muted); margin: 0; font-size: .95rem; }
.service-card__icon { color: var(--accent); }
.service-card--accent {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.service-card--accent .service-card__icon { color: var(--accent-ink); }
.service-card--accent p { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.service-card--accent:hover { transform: translateY(-3px); border-color: var(--accent-dark); }

/* ---- Project / portfolio cards ---- */
.portfolio { background: var(--bg-alt); }
.cases { display: grid; gap: 2rem; }
.case {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
  background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s;
}
.case:hover { border-color: var(--accent); }
@media (min-width: 720px) {
  .case { grid-template-columns: minmax(0, 45%) 1fr; align-items: stretch; }
}
.case__media { background: var(--bg-panel); }
.case__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case__body { padding: 1.75rem; }
.case__title { font-size: 1.4rem; margin-bottom: .75rem; }
.case__desc { color: var(--muted); }
.case__desc strong { color: var(--text); }
.case__split {
  display: grid; gap: 1rem; margin: 1.25rem 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.case__split dt {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); font-weight: 700; margin-bottom: .3rem;
}
.case__split dd { margin: 0; color: var(--muted); font-size: .95rem; }
.case__links { display: flex; align-items: center; gap: 1.25rem; margin: 1.25rem 0 0; }

.card__tags {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.card__tags li {
  font-size: .75rem; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .25rem .7rem; color: var(--muted);
}
.card__link { font-weight: 600; text-decoration: none; }
.card__link:hover { text-decoration: underline; }

/* ---- Case study (work) ---- */
.case-highlight {
  display: grid; gap: 1.5rem;
  margin: 2rem 0 2.5rem;
}
@media (min-width: 700px) {
  .case-highlight { grid-template-columns: 1.2fr 1fr; align-items: stretch; gap: 2rem; }
}

.case-media {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
  display: flex; flex-direction: column;
}
.case-media img { display: block; width: 100%; height: auto; flex: 1; object-fit: cover; }
.case-media figcaption {
  padding: .6rem 1rem;
  font-size: .8rem; color: var(--muted);
  border-top: 1px solid var(--border);
}

.case-facts {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
.case-fact {
  background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.case-fact__label {
  display: block; text-transform: uppercase; letter-spacing: .06em;
  font-size: .72rem; font-weight: 700; color: var(--accent); margin-bottom: .35rem;
}
.case-fact__value { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }

.case-body { display: grid; gap: 2.5rem; margin-top: 2.5rem; }
@media (min-width: 820px) {
  .case-body { grid-template-columns: 1.1fr .9fr; align-items: start; }
}
.case-body h3 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; }
.case-body h3:first-child { margin-top: 0; }
.case-body p { color: var(--muted); }
.case-body ul.tl__list { color: var(--muted); }

.case-quote {
  border-left: 3px solid var(--accent); margin: 1.5rem 0 0;
  padding: .2rem 0 .2rem 1.25rem;
}
.case-quote p { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; color: var(--text); margin-bottom: .4rem; }
.case-quote cite { font-style: normal; color: var(--muted); font-size: .85rem; }

.case-actions { margin-top: 2rem; }

/* ---- About ---- */
.about { max-width: 68ch; }
.about p { color: var(--muted); }

/* ---- Skills ---- */
.skills {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.skills li {
  background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem; font-weight: 500;
}

/* ---- Contact ---- */
.contact__grid {
  display: grid; gap: 3rem; grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .contact__grid { grid-template-columns: minmax(0, 380px) 1fr; align-items: start; }
}
.contact__intro p { color: var(--muted); }

.form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; }
.field input, .field textarea {
  font: inherit; padding: .7rem .8rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-panel-alt); color: var(--text);
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field textarea { resize: vertical; }
.form__status { font-weight: 500; margin: 0; }
.form__status.is-error { color: #ff7a6b; }
.form__status.is-success { color: #6fd394; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0; color: var(--muted); font-size: .9rem;
  background: var(--bg-alt);
}
.footer__grid {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: center; justify-content: space-between;
}
.footer__grid p { margin: 0; }

/* ---- Experience head ---- */
.exp__head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between; margin-bottom: 1.5rem;
}
.exp__hint {
  color: var(--muted); font-size: .9rem; margin-bottom: 1.75rem;
}

/* ---- Timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.tl { position: relative; padding-left: 2rem; margin-bottom: 1rem; }
.tl[hidden] { display: none; }
.tl__item {
  background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.tl__item:hover, .tl__item:focus-within {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--bg-panel-alt) 80%, var(--accent) 6%);
}
.tl__summary {
  display: flex; align-items: center; gap: 1rem;
  cursor: pointer; list-style: none;
  padding: 1.1rem 1.35rem;
}
.tl__summary::-webkit-details-marker { display: none; }
.tl__summary-text { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.tl__dot {
  position: absolute; left: 0; top: 1.2rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--accent);
}
.tl__role { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.tl__meta { color: var(--muted); font-size: .9rem; }
.tl__chevron {
  flex-shrink: 0; color: var(--muted);
  transition: transform .2s, color .15s;
}
.tl__item[open] .tl__chevron { transform: rotate(180deg); color: var(--accent); }
.tl__item:hover .tl__chevron, .tl__item:focus-within .tl__chevron { color: var(--accent); }
.tl__detail { padding: 0 1.35rem 1.25rem; margin-top: -.25rem; color: var(--muted); }
.tl__detail p { margin-bottom: .75rem; }

/* ---- Timeline detail lists ---- */
.tl__list { margin: .25rem 0 1rem; padding-left: 1.1rem; }
.tl__list li { margin-bottom: .5rem; }

/* ---- Skill groups ---- */
.skillgroups {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.skillgroup__title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: .85rem;
}
.skillgroup .skills { grid-template-columns: 1fr; gap: .5rem; }

/* ---- Print: clean résumé output ---- */
@media print {
  .site-header, .site-footer, .hero, .stats, .services, .portfolio,
  .exp__hint, .nav__toggle, .skip-link, .form, #contact .section__title,
  .exp__head .btn { display: none !important; }
  body { color: #000; background: #fff; }
  .section { padding: 1rem 0; }
  .tl__item, .skills li {
    border: 1px solid #ccc; break-inside: avoid;
  }
  .timeline .tl__detail { display: block !important; }
  details { display: block; }
  details > summary { list-style: none; }
  a { color: #000; text-decoration: underline; }
}
