/* ==========================================================================
   Marco Andolfatto — CV. Design tokens and web styles.
   Palette, type scale and spacing follow the design handoff.
   Border radius is 0 everywhere by design.
   ========================================================================== */

/* --- Self-hosted fonts (privacy, no render-blocking third party) ---------- */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  --forest: #08251c;
  --forest-hover: #0f3a2b;
  --beige: #f0e7d2;
  --chalk: #fffdf6;
  --lime: #c6f24d;

  --beige-82: rgba(240, 231, 210, 0.82);
  --beige-80: rgba(240, 231, 210, 0.8);
  --beige-72: rgba(240, 231, 210, 0.72);
  --beige-70: rgba(240, 231, 210, 0.7);
  --beige-66: rgba(240, 231, 210, 0.66);
  --beige-40: rgba(240, 231, 210, 0.4);
  --beige-35: rgba(240, 231, 210, 0.35);
  --beige-18: rgba(240, 231, 210, 0.18);
  --beige-12: rgba(240, 231, 210, 0.12);

  --lime-70: rgba(198, 242, 77, 0.7);
  --lime-60: rgba(198, 242, 77, 0.6);
  --lime-40: rgba(198, 242, 77, 0.4);
  --ink-tint: rgba(8, 37, 28, 0.08);
  --ghost: rgba(240, 231, 210, 0.045);

  --display: "Bricolage Grotesque", "Schibsted Grotesk", system-ui, sans-serif;
  --body: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;

  --pad-x: clamp(20px, 5vw, 72px);
  --maxw: 1200px;
  --rule: 2px solid var(--beige);
}

/* --- Base ----------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--forest);
  color: var(--beige);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--lime);
  text-decoration: none;
  border-bottom: 1px solid var(--lime-40);
}

a:hover {
  color: var(--chalk);
  border-bottom-color: var(--chalk);
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--lime);
  color: var(--forest);
}

/* One visible focus treatment for the whole page, adapted on the lime slab. */
:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.slab--contact :focus-visible {
  outline-color: var(--forest);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 80;
  padding: 12px 18px;
  background: var(--lime);
  color: var(--forest);
  border: none;
  border-bottom: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translateY(-250%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --- Shared bits ---------------------------------------------------------- */

.shell {
  position: relative;
  overflow: hidden;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}

.label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lime);
}

.section {
  padding: clamp(48px, 7vw, 96px) var(--pad-x);
  border-bottom: var(--rule);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
}

.btn--pdf {
  padding: 16px 26px;
  background: var(--lime);
  color: var(--forest);
  border: none;
  border-bottom: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: 52px;
}

.btn--pdf:hover {
  background: var(--chalk);
  color: var(--forest);
  border-bottom-color: transparent;
}

.btn--ghost {
  background: none;
  border: 1px solid var(--beige-35);
  color: var(--beige);
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  min-height: 44px;
}

.btn--ghost:hover {
  background: var(--beige);
  color: var(--forest);
}

.btn--lime {
  background: none;
  border: 1px solid var(--lime);
  color: var(--lime);
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  min-height: 44px;
}

.btn--lime:hover {
  background: var(--lime);
  color: var(--forest);
}

/* --- Scroll progress ------------------------------------------------------ */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--beige-12);
  z-index: 60;
}

.progress__fill {
  height: 100%;
  width: 0;
  background: var(--lime);
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(64px, 10vw, 120px) var(--pad-x) clamp(40px, 6vw, 72px);
  border-bottom: var(--rule);
}

.hero__ghost {
  position: absolute;
  right: -6vw;
  top: -4vw;
  font-family: var(--display);
  font-weight: 800;
  font-size: 46vw;
  line-height: 0.7;
  color: var(--ghost);
  pointer-events: none;
  user-select: none;
}

.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.hero__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--lime);
  border-radius: 50%;
  flex: 0 0 auto;
}

.hero__kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lime);
}

.hero__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(52px, 13.2vw, 186px);
  line-height: 0.82;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  color: var(--beige);
}

.hero__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 56px);
  align-items: flex-end;
  justify-content: space-between;
  margin-top: clamp(28px, 4vw, 48px);
}

.hero__blurb {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.5;
  max-width: 30ch;
  color: var(--beige-72);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* so each underline hugs its own link */
  gap: 6px;
  font-size: 14px;
}

/* --- Metrics ticker ------------------------------------------------------- */

.ticker {
  background: var(--lime);
  border-bottom: 2px solid var(--forest);
  overflow: hidden;
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: slide 26s linear infinite;
}

.ticker__run {
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 16px 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 26px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--forest);
  white-space: nowrap;
}

@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* --- Summary -------------------------------------------------------------- */

.summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(28px, 5vw, 72px);
}

.summary__body {
  grid-column: span 2;
  min-width: 0;
}

.summary__text {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(21px, 3vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--beige);
  text-wrap: pretty;
}

/* --- Stat grid ------------------------------------------------------------ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-bottom: var(--rule);
}

.stat {
  padding: clamp(28px, 4vw, 52px) clamp(20px, 3vw, 36px);
  border-right: var(--rule);
  color: var(--beige);
}

.stat:last-child {
  border-right: none;
}

.stat:hover {
  background: var(--lime);
  color: var(--forest);
}

.stat__figure {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(56px, 8vw, 104px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: inherit;
}

.stat__caption {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.72;
}

/* --- Experience ----------------------------------------------------------- */

.experience__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: clamp(28px, 4vw, 48px) var(--pad-x) clamp(16px, 2vw, 24px);
}

.role {
  border-top: var(--rule);
  padding: clamp(26px, 4vw, 44px) var(--pad-x);
  color: var(--beige);
}

.role:hover {
  background: var(--forest-hover);
}

.role__row {
  display: flex;
  gap: clamp(16px, 3vw, 44px);
  align-items: flex-start;
  flex-wrap: wrap;
}

.role__index {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--lime);
  flex: 0 0 auto;
}

.role__body {
  flex: 1 1 420px;
  min-width: 0;
}

.role__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: inherit;
}

.role__company {
  color: var(--lime);
}

.role__context {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--beige-66);
  max-width: 64ch;
}

.role__date {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--beige-70);
  white-space: nowrap;
}

.bullets {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bullets li {
  display: flex;
  gap: 14px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.45;
  color: inherit;
}

.bullets li::before {
  content: "\2192";
  color: var(--lime);
  flex: 0 0 auto;
}

/* Collapsible detail: grid-rows interpolation, so long content never clips. */
.role__more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s ease, opacity 0.3s ease;
}

.role__more[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
}

.role__more > div {
  overflow: hidden;
  min-height: 0;
}

.role__more .bullets {
  margin-top: 14px;
}

.role__toggle {
  margin-top: 22px;
}

.role__chevron {
  display: inline-block;
  transition: transform 0.3s ease;
}

.role__toggle[aria-expanded="true"] .role__chevron {
  transform: rotate(180deg);
}

/* Earlier band */
.earlier {
  border-top: var(--rule);
  border-bottom: var(--rule);
  padding: clamp(26px, 4vw, 44px) var(--pad-x);
}

.earlier__row {
  display: flex;
  gap: clamp(16px, 3vw, 44px);
  flex-wrap: wrap;
}

.earlier__list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.earlier__list li {
  display: flex;
  gap: 14px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--beige-82);
}

.earlier__list li::before {
  content: "\2192";
  color: var(--lime-60);
  flex: 0 0 auto;
}

/* --- Education / certifications / languages ------------------------------- */

.creds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.creds__cell {
  padding: clamp(30px, 4vw, 56px) clamp(20px, 4vw, 48px);
  border-right: var(--rule);
  border-bottom: var(--rule);
}

.creds__cell:last-child {
  border-right: none;
}

.creds__cell .label {
  margin-bottom: 26px;
}

.creds__cell .label + .label {
  margin-bottom: 20px;
}

.degree {
  margin-bottom: 26px;
}

.degree:last-child {
  margin-bottom: 0;
}

.degree__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.degree__school {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--beige-80);
}

.degree__meta {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.degree__modules {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--beige-72);
}

.certs {
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.certs li {
  font-size: 16px;
  line-height: 1.35;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--beige-18);
}

.certs li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.langs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.langs__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.langs__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.langs__level {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

/* --- Skills --------------------------------------------------------------- */

.skills {
  padding: clamp(36px, 5vw, 72px) var(--pad-x);
  border-bottom: var(--rule);
}

.skills > .label {
  margin-bottom: 30px;
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(26px, 3vw, 48px);
}

.skills__heading {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: stretch;
}

.chip {
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 14px;
  border: 1px solid var(--beige-40);
}

/* --- Glossary terms and tooltip ------------------------------------------- */

.term {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  cursor: help;
  border-bottom: 1px dotted var(--beige-70);
  line-height: inherit;
}

.term--strong {
  color: var(--lime);
  border-bottom: 2px dotted var(--lime-60);
}

.term--chip {
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 14px;
  border: 1px solid var(--lime-70);
  color: var(--lime);
}

.tip {
  position: fixed;
  z-index: 70;
  left: 0;
  top: 0;
  max-width: 280px;
  padding: 14px 16px;
  background: var(--lime);
  color: var(--forest);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.tip[hidden] {
  display: none !important;
}

.tip__title {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 6px;
}

/* --- Contact -------------------------------------------------------------- */

.slab--contact {
  background: var(--lime);
  color: var(--forest);
  padding: clamp(40px, 6vw, 88px) var(--pad-x);
}

.contact__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(38px, 8vw, 104px);
  line-height: 0.88;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.contact__stand {
  margin: 20px 0 34px;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.5;
  max-width: 46ch;
  font-weight: 500;
}

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  max-width: 840px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field--wide {
  grid-column: 1 / -1;
}

.field input,
.field textarea {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--forest);
  padding: 15px 16px;
  background: transparent;
  border: 2px solid var(--forest);
  border-radius: 0;
  min-height: 52px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  background: var(--ink-tint);
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(8, 37, 28, 0.45);
}

.form__foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.btn--send {
  padding: 17px 34px;
  background: var(--forest);
  color: var(--lime);
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  min-height: 52px;
}

.btn--send:hover:not(:disabled) {
  background: var(--chalk);
  color: var(--forest);
}

.btn--send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form__note {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  max-width: 34ch;
  opacity: 0.75;
}

.form__status {
  grid-column: 1 / -1;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
}

.form__status:empty {
  display: none;
}

.form__status[data-tone] {
  border-left: 4px solid var(--forest);
  padding-left: 12px;
}

.form__status a {
  color: var(--forest);
  border-bottom-color: var(--forest);
}

.form__status a:hover {
  color: var(--forest);
  opacity: 0.7;
}

/* Honeypots: off-screen for people, inviting to naive bots. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* --- Colophon ------------------------------------------------------------- */

.colophon {
  padding: 22px var(--pad-x);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--beige-70);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
}

/* --- Motion preferences --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ticker__track {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --- Print safety net -----------------------------------------------------
   The real print artefact is print.html / Marco-Andolfatto-CV.pdf. This only
   keeps an accidental Ctrl+P from producing an unreadable dark page.
   ------------------------------------------------------------------------- */

@media print {
  body {
    background: #fff;
    color: #101f1a;
  }

  .progress,
  .ticker,
  .hero__ghost,
  .role__toggle,
  #expand-all,
  .skip-link,
  .tip,
  .form,
  .colophon {
    display: none !important;
  }

  a,
  .role__company,
  .role__index,
  .label,
  .hero__kicker,
  .degree__meta,
  .langs__level,
  .term--strong,
  .term--chip,
  .bullets li::before,
  .earlier__list li::before {
    color: #0c5c43 !important;
  }

  .hero,
  .section,
  .stats,
  .stat,
  .role,
  .earlier,
  .creds__cell,
  .skills {
    border-color: #d3c9b1 !important;
  }

  .hero__name,
  .contact__title {
    font-size: 34pt;
  }

  .summary__text {
    font-size: 12pt;
  }

  .stat,
  .slab--contact {
    background: #fff !important;
    color: #101f1a !important;
  }

  .role__more {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
  }
}
