/* Jose Luis Rosa Soler, digital CV
   Type: Schibsted Grotesk (structure, names, data) + Newsreader (reading text). Both SIL OFL.
   Grid: 12 columns. Index column (1–3) carries section titles and the portrait;
   content column (5–12) carries everything a recruiter reads. */

@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/schibsted-grotesk-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/schibsted-grotesk-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/schibsted-grotesk-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/newsreader-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/newsreader-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/newsreader-latin-500-normal.woff2) format("woff2"); }

:root {
  --paper: #F2F1ED;
  --ink: #1C1C1A;
  --ink-2: #3E3C38;
  --muted: #67635C;      /* 5.3:1 on paper */
  --rule: #D3D0C8;
  --rule-strong: #1C1C1A;
  --accent: #6B2A22;     /* oxblood, used only for the franchise figure and focus */

  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 5vw, 72px);
  --col-gap: clamp(16px, 2.2vw, 32px);
  --max: 1280px;
  --section-space: clamp(64px, 8vw, 120px);
  --header-h: 60px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: inherit; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px + env(safe-area-inset-top, 0px));
  background: var(--paper);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }
main:focus { outline: none; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
}
.masthead__inner {
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto; padding-inline: var(--gutter);
}
.masthead__home { font-weight: 500; text-decoration: none; letter-spacing: -0.005em; white-space: nowrap; }
.masthead__nav { margin-left: auto; }
.masthead__nav ul { display: flex; gap: 28px; }
.masthead__nav a { text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; }
.masthead__nav a:hover { color: var(--ink); text-decoration: underline; }
.masthead__actions { display: flex; align-items: center; gap: 20px; }
.masthead__lang { font-size: 0.9375rem; color: var(--ink-2); text-decoration: none; padding: 6px 2px; }
.masthead__lang:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-weight: 500; font-size: 1rem; letter-spacing: 0.005em;
  text-decoration: none; border-radius: 2px;
}
.button:hover { background: #000; text-decoration: none; }
.button--compact { min-height: 36px; padding: 0 16px; font-size: 0.9375rem; }
.textlink { font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule-strong); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 104px); align-items: start; }
.hero__portrait { grid-column: 1 / span 3; }
.hero__portrait img {
  width: min(100%, 160px);
  aspect-ratio: 1; object-fit: cover;
  border-radius: 50%;
  background: var(--rule);
}
.hero__body { grid-column: 5 / span 8; }
.hero__name {
  font-weight: 500;
  font-size: clamp(2.5rem, 1.35rem + 4.1vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.032em;
  margin-top: -0.06em;
}
.hero__headline {
  margin-top: clamp(18px, 2vw, 28px);
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);
  line-height: 1.2;
}
.hero__focus { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.hero__profile {
  margin-top: clamp(28px, 3vw, 40px);
  max-width: 34em;
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
  hanging-punctuation: first;
}
.hero__contact {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; column-gap: 28px; row-gap: 6px;
  font-size: 0.9375rem; color: var(--ink-2);
}
.hero__contact a { text-decoration-color: var(--rule); }
.hero__actions { margin-top: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 28px; }

/* ---------- Snapshot ---------- */
.snapshot { margin-top: clamp(56px, 7vw, 104px); }
.snapshot__list {
  grid-column: 5 / span 8;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap);
  border-top: 1px solid var(--rule-strong);
  padding-top: 20px;
}
.snapshot__item { display: flex; flex-direction: column; gap: 10px; }
@supports (grid-template-rows: subgrid) {
  .snapshot__list { grid-template-rows: auto auto; row-gap: 22px; }
  .snapshot__item { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 0; }
  .snapshot__figure { align-self: last baseline; }
}
.snapshot__figure {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
  line-height: 1.02; letter-spacing: -0.01em;
}
.snapshot__item--lead .snapshot__figure { color: var(--accent); font-size: clamp(2.75rem, 1.8rem + 3vw, 4.25rem); line-height: 0.9; }
.snapshot__caption { font-size: 0.9375rem; color: var(--muted); max-width: 22em; }

/* ---------- Sections ---------- */
.section { margin-top: var(--section-space); align-items: start; }
.section--tight { margin-top: clamp(40px, 5vw, 64px); }
.section__title {
  grid-column: 1 / span 3;
  position: sticky; top: calc(var(--header-h) + 28px);
  padding-top: 18px;
  border-top: 1px solid var(--rule-strong);
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.005em;
}
.section__body { grid-column: 5 / span 8; border-top: 1px solid var(--rule-strong); padding-top: 18px; }

/* ---------- Experience ---------- */
.job + .job { margin-top: clamp(48px, 5vw, 72px); padding-top: clamp(28px, 3vw, 36px); border-top: 1px solid var(--rule); }
.job__meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 24px; row-gap: 2px; color: var(--muted); font-size: 0.9375rem; }
.job__logo { height: 16px; width: auto; margin-left: auto; opacity: 0.85; filter: grayscale(1); }
.job__head { margin-top: 10px; }
.job__company { font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.job__note { margin-top: 4px; font-size: 0.9375rem; color: var(--muted); }
.job__roles { margin-top: 18px; display: grid; gap: 4px; }
.job__roles li { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 16px; align-items: baseline; }
.job__role { font-size: 1.125rem; font-weight: 500; }
.job__role-dates { font-size: 0.9375rem; color: var(--muted); }
.job__roles li + li .job__role { font-weight: 400; color: var(--ink-2); }
.job__bullets { margin-top: 18px; display: grid; gap: 10px; max-width: 36em; }
.job__bullets li {
  position: relative; padding-left: 1.25em;
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.5; color: var(--ink-2);
}
.job__bullets li::before {
  content: ""; position: absolute; left: 0; top: 0.72em;
  width: 0.5em; height: 1px; background: var(--ink);
}
.job__link { margin-top: 18px; font-size: 0.9375rem; }

/* ---------- Earlier experience ---------- */
.earlier__item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: var(--col-gap); padding-block: 16px; }
.earlier__item + .earlier__item { border-top: 1px solid var(--rule); }
.earlier__item:first-child { padding-top: 0; }
.earlier__dates { font-size: 0.9375rem; color: var(--muted); padding-top: 2px; }
.earlier__head { font-size: 1.0625rem; font-weight: 400; line-height: 1.35; }
.earlier__company { font-weight: 500; }
.earlier__company::after { content: ","; }
.earlier__role { color: var(--ink-2); }
.earlier__line { margin-top: 4px; font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; color: var(--ink-2); max-width: 38em; }
.earlier__place { display: block; margin-top: 2px; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }

/* ---------- Expertise ---------- */
.expertise { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 32px; }
.expertise__name { font-size: 0.9375rem; font-weight: 600; color: var(--ink); padding-bottom: 10px; }
.expertise__list li { font-family: var(--serif); font-size: 1.125rem; line-height: 1.35; padding-block: 8px; border-top: 1px solid var(--rule); }
.expertise__tools { margin-top: 28px; font-size: 0.9375rem; color: var(--ink-2); }
.expertise__tools span { color: var(--muted); margin-right: 12px; }

/* ---------- Education & languages ---------- */
.edu__item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: var(--col-gap); padding-block: 16px; }
.edu__item:first-child { padding-top: 0; }
.edu__item + .edu__item { border-top: 1px solid var(--rule); }
.edu__dates { font-size: 0.9375rem; color: var(--muted); padding-top: 3px; }
.edu__title { font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.edu__item--major .edu__title { font-size: 1.375rem; letter-spacing: -0.01em; }
.edu__detail { margin-top: 4px; font-size: 0.9375rem; color: var(--ink-2); }
.edu__item:not(.edu__item--major) .edu__title { font-weight: 400; }

.langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 16px; }
.langs dt { font-size: 1.125rem; font-weight: 500; }
.langs dd { margin-top: 2px; font-size: 0.9375rem; color: var(--ink-2); }

/* ---------- Contact ---------- */
.contact__intro { font-family: var(--serif); font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem); line-height: 1.35; max-width: 26em; }
.contact__list { margin-top: 28px; display: grid; gap: 10px; }
.contact__list div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: var(--col-gap); align-items: baseline; }
.contact__list dt { font-size: 0.9375rem; color: var(--muted); }
.contact__list dd { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); font-weight: 500; overflow-wrap: anywhere; }
.downloads__title { margin-top: 48px; font-size: 0.9375rem; font-weight: 600; }
.downloads { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); border-top: 1px solid var(--rule-strong); }
.downloads li { border-bottom: 1px solid var(--rule); }
.downloads a { display: flex; flex-direction: column; gap: 2px; padding: 14px 0 16px; text-decoration: none; }
.downloads__name { font-weight: 500; font-size: 1.0625rem; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
.downloads a:hover .downloads__name { text-decoration-color: var(--accent); }
.downloads__meta { font-size: 0.875rem; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { margin-top: var(--section-space); border-top: 1px solid var(--rule); }
.footer__inner {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
  font-size: 0.875rem; color: var(--muted);
}

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .masthead__nav ul { gap: 20px; }
  .hero__portrait { grid-column: 1 / span 3; }
  .hero__body { grid-column: 4 / span 9; }
  .snapshot__list, .section__body { grid-column: 4 / span 9; }
  .section__title { grid-column: 1 / span 3; }
}

@media (max-width: 900px) {
  .masthead__nav { display: none; }
  .masthead__actions { margin-left: auto; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .hero { display: block; max-width: calc(720px + 2 * var(--gutter)); }
  .hero__portrait img { width: 120px; }
  .hero__body { margin-top: 28px; }
  .snapshot, .section { max-width: calc(720px + 2 * var(--gutter)); }
  .snapshot__list, .section__body, .section__title { grid-column: 1 / -1; }
  .section__title { position: static; border-top: 1px solid var(--rule-strong); padding-top: 16px; font-size: 1.25rem; }
  .section__body { border-top: 0; padding-top: 20px; }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  :root { --header-h: 56px; }
  .masthead__home { font-size: 0.9375rem; }
  .masthead__actions { gap: 14px; }
  .hero { padding-top: 32px; }
  .hero__portrait img { width: 96px; }
  .hero__name { font-size: clamp(2.25rem, 9.5vw, 2.75rem); line-height: 1.02; }
  .hero__profile { font-size: 1.125rem; }
  .hero__contact { flex-direction: column; }
  .hero__actions .button { flex: 1 1 100%; }
  .hero__actions .textlink { padding: 8px 0; }
  .snapshot__list { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .snapshot__list { grid-template-rows: none; }
  .snapshot__item { display: grid; grid-row: auto; grid-template-rows: none; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 16px; align-items: baseline; }
  .snapshot__figure { align-self: baseline; }
  .snapshot__item + .snapshot__item { border-top: 1px solid var(--rule); padding-top: 16px; }
  .snapshot__figure { font-size: 1.5rem; }
  .snapshot__item--lead .snapshot__figure { font-size: 3.5rem; }
  .job__bullets li { font-size: 1.0625rem; }
  .job__logo { display: none; }
  .earlier__item, .edu__item { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .expertise { grid-template-columns: minmax(0, 1fr); }
  .langs { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .langs__item { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
  .contact__list div { grid-template-columns: minmax(0, 1fr); }
  .downloads { grid-template-columns: minmax(0, 1fr); }
  .footer__inner { flex-direction: column; gap: 4px; }
}

/* ---------- Print: the PDF is the printable CV; this keeps a browser print clean ---------- */
@media print {
  @page { size: A4; margin: 16mm; }
  :root { padding: 0; }
  html, body { background: #fff; font-size: 10pt; }
  .masthead, .skip, .hero__actions, .downloads__title, .downloads, .footer { display: none !important; }
  .grid { display: block; padding: 0; max-width: none; }
  .hero { padding-top: 0; display: grid; grid-template-columns: 30mm 1fr; column-gap: 8mm; }
  .hero__portrait img { width: 28mm; }
  .hero__name { font-size: 24pt; }
  .hero__headline { font-size: 13pt; margin-top: 3mm; }
  .hero__profile { font-size: 10.5pt; max-width: none; }
  .snapshot, .section { margin-top: 8mm; }
  .section__title { position: static; margin-bottom: 3mm; }
  .section__body { border-top: 0; padding-top: 0; }
  .job, .earlier__item, .edu__item { break-inside: avoid; }
  .job__bullets li, .earlier__line, .expertise__list li { font-size: 10pt; }
  a { text-decoration: none; }
}
