/* ═══════════════════════════════════════════════════════════════════════
   andreuplaya.com
   Light palette = "technical drawing": cool paper, steel rules.
   Dark palette  = "control cabinet": steel near-black, signal amber.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #EEF1F4;
  --surface:   #FFFFFF;
  --surface-2: #E4E9ED;
  --line:      #C7D0D8;
  --text:      #16202A;
  --text-dim:  #566571;
  --accent:    #B26A00;
  --accent-2:  #0E7C93;
  --led:       #C2410C;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body:    "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono:    "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --rail: 21rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #12171C;
    --surface:   #1A2128;
    --surface-2: #222B33;
    --line:      #2E3A44;
    --text:      #E4EAEF;
    --text-dim:  #93A2AE;
    --accent:    #F2A33C;
    --accent-2:  #4FC3D9;
    --led:       #F2A33C;
  }
}
:root[data-theme="dark"] {
  --bg:        #12171C;
  --surface:   #1A2128;
  --surface-2: #222B33;
  --line:      #2E3A44;
  --text:      #E4EAEF;
  --text-dim:  #93A2AE;
  --accent:    #F2A33C;
  --accent-2:  #4FC3D9;
  --led:       #F2A33C;
}

/* ── Base ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p, ul { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--surface); color: var(--text);
  padding: .6rem 1rem; border: 1px solid var(--line);
}
.skip:focus { left: .75rem; top: .75rem; }

/* mono label, like silkscreen printing on a panel */
.label {
  font: 500 .6875rem/1 var(--f-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.shell {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 78rem;
  margin: 0 auto;
  padding: var(--gutter);
}
@media (min-width: 62rem) {
  .shell { grid-template-columns: var(--rail) 1fr; align-items: start; }
  .rail { position: sticky; top: var(--gutter); height: calc(100vh - var(--gutter) * 2); display: flex; flex-direction: column; }
}

/* ── Rail ──────────────────────────────────────────────────────────── */
.rail__id { display: flex; flex-direction: column; gap: .75rem; }
.status { display: flex; align-items: center; gap: .5rem; }
.led {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 22%, transparent);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.rail h1 { font-size: clamp(2.1rem, 5vw, 2.7rem); font-weight: 700; line-height: 1.05; }
.rail__role { font-family: var(--f-display); font-weight: 500; font-size: 1.0625rem; color: var(--accent); }
.rail__blurb { color: var(--text-dim); font-size: .9375rem; max-width: 32ch; }

.nav { display: none; }
@media (min-width: 62rem) {
  .nav { display: flex; flex-direction: column; gap: .1rem; margin-top: 3rem; }
}
.nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .45rem 0;
  text-decoration: none;
  font: 500 .75rem/1 var(--f-mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim);
  transition: color .18s ease;
}
.nav a::before {
  content: ""; width: 1.75rem; height: 1px; background: var(--line);
  transition: width .22s ease, background-color .22s ease;
}
.nav a:hover, .nav a:focus-visible, .nav a.is-active { color: var(--text); }
.nav a:hover::before, .nav a:focus-visible::before, .nav a.is-active::before { width: 3rem; background: var(--accent); }

.rail__foot { margin-top: auto; padding-top: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }
.social { display: flex; gap: 1.25rem; }
.social a { color: var(--text-dim); display: inline-flex; transition: color .18s ease, transform .18s ease; }
.social a:hover, .social a:focus-visible { color: var(--accent); transform: translateY(-2px); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .7rem 1.1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  text-decoration: none;
  font: 500 .75rem/1 var(--f-mono);
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.btn:hover, .btn:focus-visible { background: var(--accent); color: var(--bg); }

/* ── Sections ──────────────────────────────────────────────────────── */
main { display: flex; flex-direction: column; gap: clamp(3.5rem, 8vw, 6rem); }
section { scroll-margin-top: 2rem; }
.sec__head {
  display: flex; align-items: baseline; gap: 1rem;
  padding-bottom: .75rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.sec__head h2 { font-size: 1.375rem; font-weight: 600; }
.sec__head .label { margin-left: auto; }

.prose { max-width: 62ch; display: flex; flex-direction: column; gap: 1rem; color: var(--text-dim); }
.prose strong { color: var(--text); font-weight: 500; }

/* ── Skills: control panel modules ─────────────────────────────────── */
.panel { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 40rem) { .panel { grid-template-columns: 1fr 1fr; } }
.module { background: var(--surface); padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; }
.module__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.module h3 { font-size: 1.0625rem; font-weight: 600; }
.module p { color: var(--text-dim); font-size: .9375rem; }

.tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .35rem; }
.tag {
  font: 400 .6875rem/1 var(--f-mono);
  padding: .35rem .5rem;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 26%, transparent);
}

/* ── Timeline ──────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.entry {
  display: grid; gap: .35rem 1.5rem;
  padding: 1.25rem 0 1.5rem 1.5rem;
  border-left: 1px solid var(--line);
  position: relative;
}
@media (min-width: 46rem) { .entry { grid-template-columns: 9rem 1fr; } }
.entry::before {
  content: ""; position: absolute; left: -3.5px; top: 1.85rem;
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}
.entry__when { color: var(--text-dim); font: 400 .75rem/1.6 var(--f-mono); letter-spacing: .06em; }
.entry h3 { font-size: 1.0625rem; font-weight: 600; }
.entry__org { color: var(--accent-2); font-size: .9375rem; }
.entry p { color: var(--text-dim); font-size: .9375rem; margin-top: .35rem; }

/* ── Projects ──────────────────────────────────────────────────────── */
.projects { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project {
  background: var(--surface);
  padding: 1.5rem;
  display: grid; gap: .5rem 1.5rem;
  text-decoration: none;
  transition: background-color .2s ease;
}
@media (min-width: 46rem) { .project { grid-template-columns: 5.5rem 1fr; } }
.project:hover, .project:focus-visible { background: var(--surface-2); }
.project__year { color: var(--text-dim); font: 400 .75rem/1.9 var(--f-mono); letter-spacing: .06em; }
.project h3 { font-size: 1.0625rem; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.project h3 svg {
  width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 2;
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity .2s ease, transform .2s ease;
}
.project:hover h3 svg, .project:focus-visible h3 svg { opacity: 1; transform: none; }
.project p { color: var(--text-dim); font-size: .9375rem; margin-top: .25rem; }

/* running-in-production badge */
.live {
  font: 500 .625rem/1 var(--f-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: .3rem .45rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.live::before {
  content: ""; width: .375rem; height: .375rem; border-radius: 50%;
  background: var(--accent);
  animation: pulse 3.2s ease-in-out infinite;
}

/* earlier work, listed compactly */
.earlier { margin-top: 1.75rem; display: flex; flex-direction: column; gap: .75rem; }
.earlier__head { display: flex; align-items: baseline; gap: .75rem; }
.earlier ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.earlier li { display: flex; gap: 1rem; font-size: .9375rem; color: var(--text-dim); flex-wrap: wrap; }
.earlier .year { font: 400 .75rem/1.7 var(--f-mono); color: var(--text-dim); min-width: 3rem; }
.earlier a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.earlier a:hover { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════
   Project pages — overview, screenshots and the running changelog
   ═══════════════════════════════════════════════════════════════════ */
.page { max-width: 60rem; margin: 0 auto; padding: var(--gutter); display: flex; flex-direction: column; gap: 3rem; }
.page__bar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; align-items: center; }
.page__bar a { text-decoration: none; }
.page__bar a:hover { color: var(--accent); }

.proj__head { display: flex; flex-direction: column; gap: .85rem; }
.proj__name { font-family: var(--f-mono); font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -.02em; }
.proj__line { font-size: 1.0625rem; color: var(--text); max-width: 58ch; }

/* status strip: the facts, read at a glance */
.strip { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 34rem) { .strip { grid-template-columns: repeat(3, 1fr); } }
.strip__cell { background: var(--surface); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
.strip__val { font: 500 .875rem/1.3 var(--f-mono); color: var(--text); }
.strip__val--live { color: var(--accent); display: flex; align-items: center; gap: .45rem; }
.strip__val--live::before {
  content: ""; width: .375rem; height: .375rem; border-radius: 50%;
  background: var(--accent); animation: pulse 3.2s ease-in-out infinite;
}

/* screenshots: the only thing the log ever shows of the running app */
.shots { display: grid; gap: 1rem; }
@media (min-width: 46rem) { .shots--pair { grid-template-columns: 1fr 1fr; } }
figure { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
figure img { width: 100%; height: auto; display: block; border: 1px solid var(--line); background: var(--surface-2); }
figcaption { font: 400 .8125rem/1.5 var(--f-body); color: var(--text-dim); }
.shot--empty {
  border: 1px dashed var(--line);
  background: var(--surface);
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}

/* ── Changelog ─────────────────────────────────────────────────────── */
.log { display: flex; flex-direction: column; }
.log__month {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  padding: 1.5rem 0 .5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .25rem;
}
.log__month:first-child { padding-top: 0; }

.log__entry {
  display: grid; gap: .4rem 1.5rem;
  padding: 1.15rem 0 1.25rem 1.5rem;
  border-left: 1px solid var(--line);
  position: relative;
}
@media (min-width: 46rem) { .log__entry { grid-template-columns: 7rem 1fr; } }
.log__entry::before {
  content: ""; position: absolute; left: -3.5px; top: 1.7rem;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line);
}
.log__entry--mark::before { background: var(--accent); }
.log__date { font: 400 .75rem/1.7 var(--f-mono); color: var(--text-dim); letter-spacing: .04em; }
.log__body { display: flex; flex-direction: column; gap: .45rem; }
.log__title { font-family: var(--f-display); font-weight: 600; font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.log__body p { color: var(--text-dim); font-size: .9375rem; }

/* what kind of change it was — a dot, not a rainbow of chips */
.kind {
  font: 400 .625rem/1 var(--f-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: .4rem;
  white-space: nowrap;
}
.kind::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.kind--feature  { color: var(--accent-2); }
.kind--security { color: var(--accent); }
.kind--infra    { color: var(--text-dim); }
.kind--refactor { color: var(--text-dim); }
.kind--start    { color: var(--accent); }

/* ── Contact ───────────────────────────────────────────────────────── */
.contact { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
.contact__mail {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: .15rem;
  word-break: break-word;
}
.contact__mail:hover { color: var(--accent); }

footer {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between;
}

/* ── Motion ────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   CV page — same tokens, single column, built to print to PDF
   ═══════════════════════════════════════════════════════════════════ */
.cv {
  max-width: 52rem;
  margin: 0 auto;
  padding: var(--gutter);
  display: flex; flex-direction: column; gap: 2.25rem;
}
.cv__bar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; }

.cv__head { display: flex; flex-direction: column; gap: .5rem; }
.cv__head h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); font-weight: 700; line-height: 1.05; }
.cv__head .cv__role { font-family: var(--f-display); font-weight: 500; font-size: 1.0625rem; color: var(--accent); }
.cv__contact { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font: 400 .8125rem/1.6 var(--f-mono); color: var(--text-dim); }
.cv__contact a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.cv__contact a:hover { color: var(--accent); border-color: var(--accent); }

.cv section { display: flex; flex-direction: column; gap: 1rem; }
.cv h2 {
  font: 500 .6875rem/1 var(--f-mono);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}
.cv__summary { color: var(--text-dim); max-width: 68ch; }

.job { display: flex; flex-direction: column; gap: .4rem; break-inside: avoid; }
.job__top { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; justify-content: space-between; }
.job h3 { font-size: 1rem; font-weight: 600; }
.job__org { color: var(--accent-2); font-size: .9375rem; }
.job__when { font: 400 .75rem/1.6 var(--f-mono); color: var(--text-dim); letter-spacing: .04em; white-space: nowrap; }
.job ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.job li { position: relative; padding-left: 1rem; color: var(--text-dim); font-size: .9375rem; }
.job li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

.cv__grid { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .cv__grid { grid-template-columns: 1fr 1fr; } }
.cv__block { display: flex; flex-direction: column; gap: .4rem; break-inside: avoid; }
.cv__block h3 { font-size: .9375rem; font-weight: 600; }
.cv__block p { color: var(--text-dim); font-size: .875rem; }

@media print {
  @page { margin: 14mm; }
  :root {
    --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF;
    --line: #B9C3CB; --text: #101820; --text-dim: #3D4A55;
    --accent: #8A5200; --accent-2: #0B5F72;
  }
  body { font-size: 10.5pt; line-height: 1.45; }
  .cv { padding: 0; gap: 1.35rem; max-width: none; }
  .cv__bar, .no-print { display: none !important; }
  .cv h2 { font-size: 8pt; }
  .cv__head h1 { font-size: 20pt; }
  .job li, .cv__block p, .cv__summary { font-size: 9.5pt; }
  a { text-decoration: none; }
  section { break-inside: avoid-page; }
}
