/* ==========================================================================
   Cozmin Paduraru, personal site
   Tokens first, then base, layout, and one section at a time.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #163853;        /* navy, same as the CV sidebar */
  --ink-deep: #0f2a3f;
  --paper: #f5f7f9;
  --text: #2f4352;
  --muted: #576774;
  --rule: #d3dce4;
  --tint: #e6edf3;
  --active: #1b8f7a;     /* "vehicle is live" green, used for dots only */

  --display: "Bricolage Grotesque", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--active); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; line-height: 1.08; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 4px;
}
.skip:focus { top: 0.75rem; }

/* ---------- Header ---------- */
.site-header { padding-block: 1.25rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); font-family: var(--display); font-size: 0.98rem; font-weight: 500; }
.site-nav a { text-decoration: none; padding-block: 0.25rem; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 600; font-size: 1rem;
  padding: 0.8rem 1.35rem; border-radius: 6px; border: 2px solid var(--ink);
  text-decoration: none; line-height: 1.1;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: var(--ink-deep); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-small { padding: 0.5rem 0.95rem; font-size: 0.92rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 8vw, 6rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; max-width: 15ch; text-wrap: balance; }
.hero .lede { margin-top: 1.6rem; max-width: 34rem; font-size: 1.2rem; line-height: 1.55; }
.hero .actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }

.fleet-figure { margin: 0; justify-self: end; width: min(100%, 24rem); }
.fleet {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px;
  padding: 0; margin: 0;
}
.fleet .d { aspect-ratio: 1; border-radius: 50%; display: block; transition: background-color 0.4s ease, transform 0.4s ease; }
.fleet .p { background: var(--ink); }
.fleet .s { background: var(--active); }
.fleet.anim .d:not(.on) { background: var(--rule); transform: scale(0.55); }

.fleet-figure figcaption { margin-top: 1.1rem; font-size: 0.98rem; line-height: 1.5; color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 0.8rem; font-family: var(--display); font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend i { width: 0.8rem; height: 0.8rem; border-radius: 50%; display: inline-block; }
.legend .k-p { background: var(--ink); }
.legend .k-s { background: var(--active); }
.replay {
  margin-left: auto; font: inherit; color: var(--ink); background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}
.replay[hidden] { display: none; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 700; }

/* What I do */
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stage { padding: 0 clamp(1rem, 2.5vw, 2rem); border-left: 1px solid var(--rule); }
.stage:first-child { padding-left: 0; border-left: 0; }
.stage:last-child { padding-right: 0; }
.stage h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.6rem; }
.stage p { max-width: 24rem; }

/* Experience */
.timeline { position: relative; }
.group + .group { margin-top: 2.5rem; }
.group-title { font-family: var(--display); font-weight: 600; font-size: 0.98rem; color: var(--muted); margin: 0 0 0.9rem 1.9rem; }
.roles { border-left: 2px solid var(--rule); margin-left: 0.45rem; }
.role { position: relative; padding-left: 1.5rem; }
.role::before {
  content: ""; position: absolute; left: -0.45rem; top: 1.45rem; width: 0.8rem; height: 0.8rem;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
}
.role[open]::before { background: var(--ink); }
.role summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem;
  align-items: baseline; padding-block: 1.05rem;
}
.role summary::-webkit-details-marker { display: none; }
.role .r-title { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.role .r-org { font-weight: 400; color: var(--muted); }
.role .r-date { font-family: var(--display); font-size: 0.95rem; color: var(--muted); white-space: nowrap; }
.role .r-line { grid-column: 1 / -1; color: var(--text); max-width: 42rem; }
.role .r-toggle { display: none; }
.role summary:hover .r-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.role summary::after {
  content: "Show details"; grid-column: 1 / -1; font-family: var(--display); font-size: 0.86rem; font-weight: 500; color: var(--muted);
}
.role[open] summary::after { content: "Hide details"; }
.role .r-body { padding: 0.2rem 0 1.6rem; max-width: 42rem; }
.role .r-body li { position: relative; padding-left: 1.2rem; margin-bottom: 0.55rem; }
.role .r-body li::before { content: ""; position: absolute; left: 0.1rem; top: 0.72em; width: 0.38rem; height: 0.38rem; border-radius: 50%; background: var(--ink); }

/* Skills */
.skill-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.skill-cols h3 { font-size: 1.15rem; font-weight: 700; padding-bottom: 0.6rem; margin-bottom: 0.8rem; border-bottom: 2px solid var(--ink); }
.skill-cols li { padding-block: 0.3rem; border-bottom: 1px solid var(--rule); }
.skill-cols li strong { font-weight: 600; color: var(--ink); }
.facts { margin-top: clamp(2.5rem, 5vw, 3.5rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.facts h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
.facts p + p { margin-top: 0.5rem; }
.facts .when { color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.portrait { width: 11rem; height: 11rem; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--ink); }
.contact h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.025em; }
.contact p { margin-top: 1rem; max-width: 34rem; }
.contact .actions { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Footer */
.site-footer { padding-block: 2rem 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 62rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .fleet-figure { justify-self: start; width: min(100%, 22rem); }
  .section-head { grid-template-columns: 1fr; gap: 1.25rem; }
  .stages { grid-template-columns: 1fr; }
  .stage { padding: 1.25rem 0; border-left: 0; border-top: 1px solid var(--rule); }
  .stage:first-child { border-top: 0; padding-top: 0; }
  .skill-cols { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .site-nav .nav-text { display: none; }
  .facts { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .portrait { width: 8rem; height: 8rem; }
  .role summary { grid-template-columns: 1fr; }
  .role .r-date { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fleet .d, .btn { transition: none; }
}

@media print {
  .site-header, .replay, .skip { display: none; }
  .role .r-body { display: block; }
  body { background: #fff; }
}
