/* Hallmark · shape: Map hero over ruled index · genre: modern-minimal · theme: Furrow (by request) · redesign: full
 * hero: Stage, headline left on the survey map, notebook card right · nav: edge-aligned, wordmark and one action · footer: one line, wordmark and credit · imagery: the product (real screenshots), the portrait · signature: a generated survey map of Como with the four live sites pinned where they stand
 * axes: light/grotesk-sans/warm · posture: committed · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V3 · weakest: V, the map is a sketch of Como not a survey, so it says so in a note */
/* Hallmark · note 58: IT and EN share the markup, one hidden by data-lang; each language stays under 450 words and its h1 under seven */
/* Hallmark · waive 23 · .band is the tangerine field band from the Furrow Range · committed posture, one band per page */
/* Hallmark · waive 49 · .index .row holds a title and a meta line · two-line list items, wrapping is intended */
/* Hallmark · dropped the four-step method grid and the stat row · their facts moved into the skills paragraph and the profile card */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --nav-h: 64px;
  --map-h: clamp(600px, 84svh, 760px);
  --container: 1280px;
  --text-col: 440px;
}
.map-frame { position: absolute; inset: 4% 24% 8% 2%; }

html[data-lang="it"] [data-l="en"],
html[data-lang="en"] [data-l="it"] { display: none !important; }

.skip { position: absolute; left: -999px; top: var(--space-xs); z-index: 60; padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); border-radius: var(--radius-pill); }
.skip:focus-visible { left: var(--space-xs); }
.muted { color: var(--color-muted); }
.num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }

/* Keys */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 48px; padding: 0 var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper-2); color: var(--color-ink);
  font-weight: 500; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-sheet), 0 1px 1px var(--color-rule);
  transition: transform 120ms var(--ease-out), background-color 160ms var(--ease-out);
}
.btn:hover { background: var(--color-sheet); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink)); box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-sheet) 32%, transparent), inset 0 -1px 0 color-mix(in oklab, var(--color-ink) 10%, transparent); }
.btn-primary:hover { background: color-mix(in oklab, var(--color-accent) 90%, var(--color-sheet)); }
.btn-sm { min-height: 40px; padding: 0 var(--space-md); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in oklab, var(--color-paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: var(--rule-hair) solid var(--color-ink); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); height: var(--nav-h); }
.wordmark { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.nav-links { display: none; gap: var(--space-lg); font-size: var(--text-sm); font-weight: 500; }
.nav-links a { text-decoration: none; padding: var(--space-xs) 0; }
.nav-links a:hover { text-decoration: underline; }
.nav-end { display: flex; align-items: center; gap: var(--space-xs); }
.lang { display: inline-flex; height: 40px; padding: var(--space-2xs); gap: var(--space-3xs); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper-2); cursor: pointer; color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; }
.lang-opt { display: grid; place-items: center; min-width: 34px; border-radius: 4px; }
html[data-lang="it"] .lang-opt[data-v="it"], html[data-lang="en"] .lang-opt[data-v="en"] { background: var(--color-ink); color: var(--color-paper); }
.lang:hover { color: var(--color-ink); }
.lang:active { transform: translateY(1px); }

/* Hero */
.hero { position: relative; border-bottom: var(--rule-hair) solid var(--color-ink); }
.map { position: relative; height: 380px; background: var(--color-paper-3); overflow: hidden; }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; left: var(--x); top: var(--y); display: flex; align-items: center; gap: var(--space-xs); transform: translate(-9px, -9px); text-decoration: none; z-index: 2; min-height: 24px; }
.pin-mark { width: 18px; height: 18px; background: var(--color-ink); box-shadow: 0 0 0 3px var(--color-paper-2); flex: none; transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out); }
.pin-disc .pin-mark { border-radius: 50%; }
.pin-diamond .pin-mark { transform: rotate(45deg) scale(0.86); }
.pin-tri .pin-mark { clip-path: polygon(50% 0, 100% 100%, 0 100%); box-shadow: none; }
.pin-tag { padding: var(--space-2xs) var(--space-xs); background: var(--color-ink); color: var(--color-paper-2); border-radius: 4px; font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
.pin:hover .pin-tag { background: var(--color-ink-2); }
.pin[aria-current="true"] .pin-mark { background: var(--color-accent); }
.pin[aria-current="true"] .pin-tag { background: var(--color-accent); color: var(--color-accent-ink); }
.map-note { position: absolute; right: var(--space-md); bottom: var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); z-index: 2; }

.hero-in { display: grid; gap: var(--space-xl); padding-top: var(--space-xl); padding-bottom: var(--space-2xl); }
.hero-text { display: flex; flex-direction: column; gap: var(--space-md); }
.hero h1 { font-size: var(--text-display); line-height: 1; }
.hero .lead { color: var(--color-ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xs); }

/* Notebook entry */
.entry-wrap { width: 100%; max-width: 380px; }
.entry { border-radius: var(--radius-entry); background: var(--color-paper-2); box-shadow: 0 0 0 1px var(--color-ink), var(--shadow-lift); overflow: hidden; }
.entry-head { display: flex; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--color-ink); color: var(--color-paper-2); font-size: var(--text-sm); font-weight: 500; }
.entry-head .num { color: var(--color-grid-strong); font-size: var(--text-xs); align-self: center; }
.entry-photo { border-bottom: var(--rule-hair) solid var(--color-ink); }
.entry-photo img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 22%; }
.entry-title { padding: var(--space-md); font-family: var(--font-display); font-weight: var(--display-weight); font-size: 2.25rem; line-height: 1; letter-spacing: var(--tracking-display); border-bottom: var(--rule-hair) solid var(--color-ink); }
.notebook { background: linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, var(--color-paper-2); }
.cells { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 0; }
.cells > div { padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-ink); min-width: 0; }
.cells > div:nth-child(odd):not(.wide) { border-right: var(--rule-hair) solid var(--color-ink); }
.cells > .wide { grid-column: 1 / -1; }
.cells > .wide ~ div:nth-of-type(2) { border-right: var(--rule-hair) solid var(--color-ink); }
.cells > .wide ~ div:nth-of-type(3) { border-right: 0; }
.cells dt { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.cells dd { margin: var(--space-3xs) 0 0; font-weight: 500; font-size: var(--text-md); line-height: 1.3; overflow-wrap: break-word; }
.entry-foot { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: stretch; min-height: 56px; }
.entry-foot > :nth-child(2) { justify-self: center; align-self: center; }
.key { display: grid; place-items: center; border: 0; background: var(--color-paper-2); color: var(--color-ink); font-size: var(--text-xl); cursor: pointer; transition: background-color 120ms var(--ease-out); }
.key:first-child { border-right: var(--rule-hair) solid var(--color-ink); }
.key:last-child { border-left: var(--rule-hair) solid var(--color-ink); }
.key:hover { background: var(--color-paper-3); }
.key:active { background: var(--color-accent-soft); }
.key:disabled { color: var(--color-rule); cursor: default; }
.key:focus-visible { outline-offset: -3px; }

.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--space-sm); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500; background: var(--color-paper-3); color: var(--color-ink); text-decoration: none; white-space: nowrap; }
a.chip { background: var(--color-accent); color: var(--color-accent-ink); min-height: 36px; }
a.chip:hover { background: color-mix(in oklab, var(--color-accent) 88%, var(--color-sheet)); }
a.chip:active { transform: translateY(1px); }
.chip-green { background: var(--color-green-soft); color: var(--color-green); }

/* Sections */
.section { padding-top: var(--section-gap); }
.section h2 { margin-bottom: var(--space-md); }
.sub { color: var(--color-muted); font-size: var(--text-lead); line-height: 1.45; max-width: 46ch; }
.split { display: grid; gap: var(--space-xl); }
.ruled { border-top: var(--rule-hair) solid var(--color-ink); }

/* Index of sites */
.index { display: grid; margin-top: var(--space-xl); }
.row { display: grid; gap: var(--space-3xs); text-align: left; padding: var(--space-md) var(--space-sm); border: 0; border-bottom: var(--rule-hair) solid var(--color-rule); background: transparent; color: var(--color-ink); cursor: pointer; transition: background-color 140ms var(--ease-out); }
.row:hover { background: var(--color-paper-3); }
.row:active { background: var(--color-accent-soft); }
.row[aria-selected="true"] { background: var(--color-paper-2); box-shadow: inset 4px 0 0 var(--color-accent); }
.row-title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-title); letter-spacing: -0.02em; line-height: 1.15; }
.row-meta { color: var(--color-muted); font-size: var(--text-sm); }

.viewer { position: relative; display: block; align-self: start; padding: 0 0 var(--space-xl) 0; text-decoration: none; }
.viewer-d { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: var(--radius-card); box-shadow: 0 0 0 1px var(--color-ink), var(--shadow-card); transition: opacity 200ms var(--ease-out); }
.viewer-m { position: absolute; right: var(--space-md); bottom: 0; width: 26%; min-width: 92px; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: var(--radius-entry); box-shadow: 0 0 0 1px var(--color-ink), 0 0 0 5px var(--color-paper-2), 0 0 0 6px var(--color-ink), var(--shadow-lift); transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out); }
.viewer.swap .viewer-d, .viewer.swap .viewer-m { opacity: 0; }
.viewer-cta { position: absolute; left: var(--space-md); bottom: calc(var(--space-xl) + var(--space-md)); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); box-shadow: 0 0 0 1px var(--color-ink); font-size: var(--text-sm); font-weight: 500; }
.viewer:hover .viewer-m { transform: translateY(-6px); }
.viewer:hover .viewer-cta { background: var(--color-sheet); }

/* Skills table */
.skills { width: 100%; border-collapse: collapse; }
.skills th, .skills td { text-align: left; vertical-align: top; padding: var(--space-md) var(--space-sm) var(--space-md) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.skills th { font-weight: 500; width: 34%; }
.skills td { color: var(--color-muted); }
.skills td:last-child { padding-right: 0; text-align: right; width: 1%; }
.skills .hot th { color: var(--color-ink); }
.skills .hot td:nth-child(2) { color: var(--color-ink-2); }

/* Path */
.path { list-style: none; margin: var(--space-xl) 0 0; padding: 0; }
.path li { display: grid; gap: var(--space-xs); padding: var(--space-lg) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.path .when { font-size: var(--text-sm); color: var(--color-muted); }
.path h3 { font-size: var(--text-title); margin-bottom: var(--space-2xs); }
.path p { color: var(--color-muted); }

/* Contact band */
.band { position: relative; margin-top: var(--section-gap); background: var(--color-accent); color: var(--color-accent-ink); border-top: var(--rule-hair) solid var(--color-ink); border-bottom: var(--rule-hair) solid var(--color-ink); overflow: hidden; }
.band canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.band-in { position: relative; display: grid; gap: var(--space-xl); padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }
.band h2 { max-width: 16ch; }
.contact { margin: 0; border-top-width: 2px; max-width: 560px; width: 100%; }
.contact > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-md); padding: var(--space-md) 0; border-bottom: var(--rule-hair) solid color-mix(in oklab, var(--color-ink) 35%, transparent); }
.contact dt { font-size: var(--text-sm); font-weight: 500; }
.contact dd { margin: 0; font-size: var(--text-lg); font-weight: 500; overflow-wrap: anywhere; }
.contact a { text-decoration: underline; text-decoration-thickness: 1px; }
.contact a:hover { text-decoration-thickness: 2px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-lg); padding-top: var(--space-lg); padding-bottom: var(--space-xl); font-size: var(--text-sm); }
.foot .wordmark { font-size: var(--text-md); }

/* Pins land in order, once */
@media (prefers-reduced-motion: no-preference) {
  .js .pin { opacity: 0; translate: 0 -8px; transition: opacity 400ms var(--ease-out), translate 400ms var(--ease-out); }
  .js .map.landed .pin { opacity: 1; translate: 0 0; }
  .js .map.landed .pin:nth-of-type(2) { transition-delay: 120ms; }
  .js .map.landed .pin:nth-of-type(3) { transition-delay: 240ms; }
  .js .map.landed .pin:nth-of-type(4) { transition-delay: 360ms; }
}

@media (min-width: 40rem) {
  .nav-links { display: flex; }
  .map { height: 460px; }
  .entry-wrap { max-width: 400px; }
}

@media (min-width: 64rem) {
  .map { position: absolute; top: 0; bottom: 0; right: 0; left: calc(max(var(--gutter), (100% - var(--container)) / 2 + var(--gutter)) + var(--text-col)); height: auto; border-left: var(--rule-hair) solid var(--color-ink); }
  .map-frame { position: absolute; top: 6%; bottom: 8%; left: 2%; width: 34%; }
  .hero { min-height: var(--map-h); }
  .hero-in { position: relative; z-index: 3; min-height: var(--map-h); grid-template-columns: calc(var(--text-col) - var(--space-xl)) minmax(0, 1fr); gap: var(--space-xl); align-items: center; padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); pointer-events: none; }
  .hero-in > * { pointer-events: auto; }
  .hero h1 { font-size: var(--text-display-s); }
  .entry-wrap { justify-self: end; align-self: center; }
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl); align-items: start; }
  .split-even { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .path li { grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-xl); }
  .band-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .key, .row, .viewer-d, .viewer-m, .pin-mark { transition: none; }
}

.key svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
@media (min-width: 64rem) {
  .pin-left { flex-direction: row-reverse; transform: translate(calc(-100% + 9px), -9px); }
}
.pin-left-all { flex-direction: row-reverse; transform: translate(calc(-100% + 9px), -9px); }
