/* Enrico Magnarello — interactive CV */

:root {
  --paper: #F6F1E8;
  --paper-2: #EBE3D4;
  --card: #FFFCF6;
  --ink: #1C1A16;
  --ink-soft: #3A3630;
  --muted: #5E584F;
  --line: #D4CBBA;
  --teal: #008184;
  --teal-mid: #008184;
  --teal-deep: #064848;
  --teal-ink: #075858;
  --accent: #E47128;
  --accent-deep: #C45A16;
  --pcb: #3D8B4F;
  --pcb-deep: #2E6B3E;
  --silk: #F3EBD4;
  --shadow: 0 1px 0 rgba(28, 26, 22, 0.04), 0 10px 28px -18px rgba(28, 26, 22, 0.28);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --header-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(ellipse 80% 50% at 0% -10%, rgba(10, 107, 107, 0.07), transparent 50%),
    radial-gradient(ellipse 46% 38% at 100% 8%, rgba(61, 139, 79, 0.08), transparent 48%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(228, 113, 40, 0.05), transparent 45%);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--teal-deep);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

a { color: var(--teal-ink); text-underline-offset: 0.15em; }
a:hover { color: var(--teal-deep); }

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

.wrap {
  width: min(48rem, calc(100% - 1.75rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.site-header.is-compact {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -20px rgba(28, 26, 22, 0.55);
}
.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--pcb) 48%, var(--accent) 100%);
}

.header-inner {
  width: min(48rem, calc(100% - 1.75rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 0 0.85rem;
  transition: padding 200ms var(--ease);
}
.site-header.is-compact .header-inner { padding: 0.55rem 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.pin {
  flex: none;
  width: 22px;
  height: 22px;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  display: block;
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.site-header.is-compact .brand-sub { display: none; }
.role-co a,
.role-title a {
  color: inherit;
  text-decoration: none;
}
.role-co a:hover,
.role-title a:hover {
  color: var(--teal-deep);
  text-decoration: underline;
}

.header-contact {
  display: flex;
  gap: 0.4rem;
  flex: none;
}
.header-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--teal-deep);
}
.header-contact a[href^="mailto"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.header-contact a:hover { filter: brightness(0.97); }
.header-contact .lbl { display: none; }

@media (min-width: 520px) {
  .header-contact .lbl { display: inline; margin-left: 0.35rem; }
  .header-contact a { padding: 0 0.9rem; }
}

/* Hero */
.hero { padding: 1.75rem 0 0.85rem; }

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--teal) 10%, var(--paper));
  color: var(--teal-deep);
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
}
.chip.accent {
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

h1.name {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.35rem, 9vw, 3.85rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.role-line {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 2.6vw, 1.22rem);
  color: var(--ink-soft);
  font-weight: 500;
  max-width: 28rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.meta-row li { display: flex; align-items: center; gap: 0.4rem; }
.meta-row svg { flex: none; opacity: 0.7; }

.pitch {
  margin: 0 0 1rem;
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 40rem;
}
.pitch.lead {
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 500;
}

/* How to read */
.read-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 1.75rem 0 0.5rem;
  padding: 1rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.read-guide p { margin: 0; }
.read-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-ink);
}
.read-steps {
  display: grid;
  gap: 0.65rem;
}
.read-step {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.55rem;
  align-items: start;
}
.num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--teal);
  color: #fff;
}
.read-step strong { display: block; font-size: 0.95rem; }
.read-step span { color: var(--muted); font-size: 0.9rem; }

@media (min-width: 640px) {
  .read-steps { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

/* Sections */
section { padding: 2.1rem 0 0.25rem; }

.sec-label {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-ink);
}

.roles { display: grid; gap: 0.85rem; }

.role {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.role[open] { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); }

.role-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.05rem 1rem 1.15rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: start;
  min-height: 48px;
}
.role-summary::-webkit-details-marker { display: none; }
.role-summary:hover { background: color-mix(in srgb, var(--teal) 4%, var(--card)); }

.role-co {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.role-title {
  grid-column: 1;
  margin: 0.15rem 0 0;
  font-size: 0.98rem;
  font-weight: 550;
  color: var(--ink-soft);
}
.role-dept {
  grid-column: 1;
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.role-where {
  grid-column: 1;
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.role-dates {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--teal-deep);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chev {
  grid-column: 2;
  grid-row: 2 / span 3;
  align-self: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--teal-deep);
  transition: transform 220ms var(--ease);
}
.role[open] .chev { transform: rotate(180deg); }

.role-body {
  padding: 0 1.05rem 1.15rem;
  border-top: 1px solid var(--line);
}

.seg {
  display: flex;
  padding: 4px;
  margin: 0.95rem 0 1rem;
  background: var(--paper-2);
  border-radius: 999px;
  gap: 4px;
}
.seg button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.6rem;
}
.seg button[aria-selected="true"] {
  background: var(--card);
  color: var(--teal-deep);
  box-shadow: 0 1px 2px rgba(28, 26, 22, 0.1);
}
.seg button:hover:not([aria-selected="true"]) { color: var(--ink); }

.panel p { margin: 0 0 0.85rem; color: var(--ink-soft); }
.panel p:last-child { margin-bottom: 0; }

.tl {
  position: relative;
  margin: 0.25rem 0 0;
  padding: 0 0 0 0.15rem;
  list-style: none;
}
.tl::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.35rem;
  bottom: 0.45rem;
  width: 2px;
  background: linear-gradient(180deg, var(--teal) 0%, var(--line) 100%);
  border-radius: 2px;
}
.tl li {
  position: relative;
  padding: 0 0 1.15rem 1.45rem;
}
.tl li:last-child { padding-bottom: 0.15rem; }
.tl li::before {
  content: "";
  position: absolute;
  left: 0.05rem;
  top: 0.42rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card);
  border: 2.5px solid var(--teal);
  box-shadow: 0 0 0 3px var(--card);
}
.tl .when {
  display: block;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-ink);
  margin-bottom: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.tl .what { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* What you are looking for — table */
#looking-for { padding-top: 0.35rem; }
.pitches { padding: 1.35rem 0 0.25rem; }

.map-table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-table {
  width: 100%;
  border-collapse: collapse;
}

.map-table thead th {
  padding: 0.7rem 1.1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-ink);
  background: color-mix(in srgb, var(--teal) 8%, var(--card));
  border-bottom: 1px solid var(--line);
}

.map-table tbody th,
.map-table tbody td {
  padding: 0.95rem 1.1rem 1.05rem;
  vertical-align: top;
  text-align: left;
  border-top: 1px solid var(--line);
}

.map-table tbody tr:first-child th,
.map-table tbody tr:first-child td { border-top: 0; }

.map-table tbody th {
  width: 38%;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: var(--ink);
}

.map-table tbody td { color: var(--ink-soft); }

.map-table ul {
  margin: 0;
  padding: 0 0 0 1.15rem;
}

.map-table li + li { margin-top: 0.32rem; }
.map-table li::marker { color: var(--teal); }

@media (max-width: 680px) {
  .map-table,
  .map-table thead,
  .map-table tbody,
  .map-table tr,
  .map-table th,
  .map-table td {
    display: block;
    width: 100%;
  }
  .map-table thead { display: none; }
  .map-table tbody th {
    padding: 1rem 1.1rem 0.25rem;
    border-top: 1px solid var(--line);
  }
  .map-table tbody td {
    padding: 0.4rem 1.1rem 1.05rem;
    border-top: 0;
  }
  .map-table tbody tr:first-child th { border-top: 0; }
}

/* Education */
.edu { display: grid; gap: 0.65rem; }
.edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  padding: 0.85rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.edu-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.edu-item p { margin: 0; color: var(--muted); font-size: 0.92rem; grid-column: 1; }
.edu-item .yrs {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.certs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}
.certs li {
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--teal) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
  font-size: 0.92rem;
}
.certs strong { color: var(--teal-deep); }
.certs span { color: var(--muted); }

/* Maker */
.maker {
  margin: 2.1rem 0 0;
  padding: 1.2rem 1.15rem 1.25rem;
  background: var(--teal-deep);
  color: #F4EFE6;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.maker .sec-label { color: color-mix(in srgb, var(--accent) 70%, #fff); margin-bottom: 0.45rem; }
.maker h2 {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
}
.maker p { margin: 0 0 0.75rem; color: #E6DFD2; }
.maker p:last-child { margin-bottom: 0; }
.maker .date-hit {
  display: inline-block;
  font-weight: 700;
  color: #fff;
  border-bottom: 2px solid var(--accent);
}

/* Footer */
.site-footer {
  margin-top: 2.4rem;
  padding: 1.4rem 0 2.4rem;
  border-top: 1px solid var(--line);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.site-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 650;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}


/* Languages */
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.langs li {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.langs strong { color: var(--teal-deep); }

/* ATMB as a full chapter */
.role.chapter {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: var(--shadow), inset 3px 0 0 var(--teal);
}


/* LED life — quiet, not a toy */
.led-power {
  animation: led-glow 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.led-tx { animation: led-tx 5.4s steps(1, end) infinite; }

@keyframes led-glow {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
@keyframes led-tx {
  0%, 12%, 18%, 100% { opacity: 0.18; }
  13%, 16% { opacity: 1; }
}

.pitch.note {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .led-power, .led-tx {
    animation: none !important;
    opacity: 1 !important;
  }
}
