/* Ygrene S.r.l. — sito istituzionale. Nessuna risorsa esterna. */

@font-face {
  font-family: "Antonio";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/antonio-700-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: "Antonio";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/antonio-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, 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("../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("../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+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --sleeve: #f4f4f1;
  --sleeve-deep: #e7e7e1;
  --ink: #121316;
  --ink-soft: #3a3d44;
  --ink-mute: #5d616b;
  --obi: #0b6e4f;
  --obi-deep: #08573e;
  --obi-text: #ffffff;
  --obi-label: #d3ebe1;
  --obi-rule: rgba(255, 255, 255, 0.32);
  --rule: #cfd0c9;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 68ch;
  --step: 8px;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --display: "Antonio", "Arial Narrow", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
  accent-color: var(--obi);
  scrollbar-color: var(--obi) var(--sleeve-deep);
}

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

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

body {
  margin: 0;
  background: var(--sleeve);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--obi); color: var(--obi-text); }
.obi ::selection, .runhead ::selection { background: var(--sleeve); color: var(--obi-deep); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color 160ms var(--ease-out);
}
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--obi); outline-offset: 3px; border-radius: 1px; }
.obi :focus-visible, .runhead :focus-visible { outline-color: var(--obi-text); }

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--ink); color: var(--sleeve); padding: 10px 16px; z-index: 10;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.num { font-variant-numeric: lining-nums; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px var(--gutter);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; letter-spacing: 0.18em; font-size: 0.9375rem; text-decoration: none;
}
.wordmark svg { width: 26px; height: 26px; flex: none; }
.topbar nav ul { display: flex; flex-wrap: wrap; gap: 6px 28px; list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.topbar nav a { text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; transition: border-color 160ms var(--ease-out); }
.topbar nav a:hover { border-bottom-color: var(--ink); }
.topbar nav a[aria-current="page"] { border-bottom: 2px solid var(--obi); }

/* ---------- Home: sleeve face + obi band ---------- */

.sleeve { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.sleeve > main { flex: 1; display: flex; flex-direction: column; }

.face {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 48px;
  padding: clamp(32px, 6vh, 72px) var(--gutter);
}
.face .mark { justify-self: center; width: clamp(150px, 19vw, 260px); height: auto; }
.face h1 {
  margin: 0; font-size: clamp(1.875rem, 1.2rem + 1.9vw, 2.5rem); line-height: 1.12; font-weight: 700;
  letter-spacing: -0.015em; max-width: 19ch; text-wrap: balance;
}
.face p { margin: 24px 0 0; max-width: 54ch; color: var(--ink-soft); font-size: 1.125rem; }

.obi {
  position: relative;
  background: var(--obi); color: var(--obi-text);
  padding: 28px var(--gutter) 32px;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 24px; row-gap: 22px;
}
.obi-name {
  grid-column: 1 / -1; margin: 0;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.75rem, 1.5rem + 4.2vw, 5.5rem); line-height: 0.92; letter-spacing: 0.02em;
}
.obi-name small { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.14em; display: block; margin-top: 10px; color: var(--obi-label); text-transform: uppercase; line-height: 1.4; }
.obi dl { display: contents; }
.obi .credit { border-left: 1px solid var(--obi-rule); padding-left: 12px; min-width: 0; }
.obi dt { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--obi-label); margin-bottom: 6px; }
.obi dd { margin: 0; font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.obi a { text-decoration-color: rgba(255, 255, 255, 0.55); }
.obi a:hover { text-decoration-color: #fff; }
.obi-spine {
  position: absolute; right: calc(var(--gutter) * 0.35); top: 28px; bottom: 32px;
  writing-mode: vertical-rl; font-size: 0.6875rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--obi-label);
  display: flex; justify-content: space-between; white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .sleeve .obi { animation: obi-settle 900ms var(--ease-out) both; }
  @keyframes obi-settle { from { transform: translateY(14px); } to { transform: none; } }
}

/* ---------- Reading sections ---------- */

.section {
  padding: clamp(56px, 9vw, 112px) var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); column-gap: 48px;
}
.section > h2 {
  margin: 0; padding-top: 14px; border-top: 3px solid var(--obi);
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; align-self: start;
  text-wrap: balance;
}
.section .body { max-width: var(--measure); border-top: 1px solid var(--ink); padding-top: 14px; }
.section .body > :first-child { margin-top: 0; }
.section h3 { font-size: 1.1875rem; line-height: 1.3; margin: 40px 0 10px; letter-spacing: -0.005em; }
.section p, .section li { color: var(--ink-soft); }
.section p { margin: 0 0 16px; }
.section strong { color: var(--ink); }
.lede { font-size: 1.1875rem; color: var(--ink) !important; line-height: 1.55; }

.steps { list-style: none; padding: 0; margin: 28px 0 8px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0 16px; padding: 18px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--obi); }
.steps strong { display: block; margin-bottom: 4px; }

.clauses { padding-left: 1.1em; margin: 0; }
.clauses li { margin-bottom: 10px; padding-left: 4px; }
.clauses li::marker { color: var(--obi); }

.note { font-size: 0.9375rem; color: var(--ink-mute) !important; }

/* ---------- Legal pages ---------- */

.runhead {
  background: var(--obi); color: var(--obi-text);
  padding: 18px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px;
  font-size: 0.8125rem; letter-spacing: 0.04em;
}
.runhead b { font-family: var(--display); font-size: 1.75rem; letter-spacing: 0.04em; line-height: 1; margin-right: 8px; }
.runhead span { color: var(--obi-label); }
.runhead span em { font-style: normal; color: var(--obi-text); }

.doc { padding: clamp(40px, 7vw, 88px) var(--gutter) 0; }
.doc > header { max-width: 60rem; }
.doc h1 { margin: 0; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; }
.doc .updated { margin-top: 12px; color: var(--ink-mute); font-size: 0.9375rem; }
.doc .section { padding-left: 0; padding-right: 0; padding-top: clamp(40px, 6vw, 72px); }

table.facts { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.facts th, table.facts td { text-align: left; vertical-align: top; padding: 12px 0; border-bottom: 1px solid var(--rule); }
table.facts th { width: 38%; font-weight: 500; color: var(--ink-mute); padding-right: 24px; font-size: 0.9375rem; }
table.facts td { color: var(--ink); }
table.facts caption { text-align: left; }

.todo { background: #ffe680; color: #3d2f00; padding: 0 4px; border-radius: 2px; font-style: normal; }
.obi .todo, .runhead span em.todo { background: #ffe680; color: #3d2f00; }

/* ---------- Footer ---------- */

.foot {
  margin-top: clamp(72px, 10vw, 128px);
  border-top: 1px solid var(--ink);
  padding: 28px var(--gutter) 40px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px;
  font-size: 0.875rem; color: var(--ink-mute);
}
.foot p { margin: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: flex-end; }
.foot a { color: var(--ink); }

/* ---------- 404 ---------- */
.lost { flex: 1; display: grid; place-content: center; text-align: center; padding: 48px var(--gutter); }
.lost svg { width: 120px; height: 120px; margin: 0 auto 24px; }
.lost h1 { margin: 0 0 8px; font-size: 1.75rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .obi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .face { grid-template-columns: 1fr; gap: 32px; }
  .face .mark { justify-self: start; width: 120px; }
  .section { grid-template-columns: 1fr; row-gap: 20px; }
  .section > h2 { border-top-width: 3px; }
  .section .body { border-top: 0; padding-top: 0; }
  .foot { grid-template-columns: 1fr; }
  .foot ul { justify-content: flex-start; }
  .obi-spine { display: none; }
}
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .topbar nav ul { gap: 6px 20px; }
  .obi { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 24px; }
  .obi .credit-pec { order: -1; grid-column: 1 / -1; }
  .obi-name { order: -2; }
  .face { padding-top: 16px; padding-bottom: 32px; gap: 24px; }
  .face .mark { width: 88px; }
  table.facts th, table.facts td { display: block; width: auto; padding: 0; border: 0; }
  table.facts th { padding-top: 12px; font-size: 0.8125rem; }
  table.facts td { padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 380px) {
  .obi { grid-template-columns: 1fr; }
}

@media print {
  .topbar nav, .skip { display: none; }
  .obi, .runhead { background: none; color: var(--ink); border: 2px solid var(--ink); }
  .obi dt, .runhead span, .obi-name small { color: var(--ink-mute); }
  .obi .credit { border-color: var(--rule); }
}
