/* Ciao Beppe — one stylesheet for every page.
   The look is the Varco app's: sepia paper with its grain, deep green ink,
   Fraunces italic for headings, Manrope for reading text, pencil hatching. */

@font-face { font-family: "Fraunces"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/Fraunces_400Regular.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/Fraunces_600SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 500; font-style: italic; font-display: swap; src: url("/assets/fonts/Fraunces_500Medium_Italic.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: italic; font-display: swap; src: url("/assets/fonts/Fraunces_600SemiBold_Italic.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/Manrope_500Medium.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/Manrope_700Bold.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/Manrope_800ExtraBold.woff2") format("woff2"); }

:root {
  --paper: #e9d8b0;          /* JF 10/22: halfway between the app's #e3cc9a and 10/19's #efe4c9 */
  --paper-light: #efe1bf;
  --ink: #1e2321;
  --ink-soft: #55625b;
  --green-deep: #1c6a3a;
  --green: #278a4c;
  --rose: #d94542;
  --hatch: #9c8a63;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(247, 241, 226, 0.25), rgba(247, 241, 226, 0.25)),
    url("/assets/paper-grain.png"),
    radial-gradient(ellipse at 50% 30%, rgba(251, 246, 234, 0.8), rgba(240, 230, 208, 0) 70%);
  background-size: 100% 100%, 256px 256px, 100% 100%;
  background-attachment: fixed, scroll, fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

a { color: var(--green-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--green); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--paper-light); padding: 0.5rem 0.75rem; }
.skip:focus { left: 0.5rem; }

/* ── header ─────────────────────────────────────────────── */
.site-head {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--green-deep); }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark .glyph { width: 2rem; height: 2rem; color: var(--green-deep); flex: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; padding: 0.2rem 0; }
.site-nav a:hover { color: var(--green-deep); }
.site-nav a[aria-current="page"] { color: var(--green-deep); font-weight: 700; box-shadow: inset 0 -2px 0 var(--green); }

/* ── page body ──────────────────────────────────────────── */
main { flex: 1; width: 100%; max-width: 60rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.prose { max-width: var(--measure); }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.15; }
h1 { font-style: italic; font-weight: 500; font-size: clamp(2.4rem, 7vw, 3.6rem); letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-style: italic; font-weight: 500; font-size: 1.75rem; margin: 2.75rem 0 0.75rem; }
h3 { font-weight: 600; font-size: 1.2rem; margin: 1.75rem 0 0.4rem; }
p, ul, ol, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }
.lede { font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; color: var(--ink); max-width: 34rem; }
.muted { color: var(--ink-soft); }
.updated { color: var(--ink-soft); font-size: 0.95rem; }

/* A pencil-shaded link, like a selected answer box in the app */
.hatched {
  display: inline-block;
  font-weight: 700;
  color: var(--green-deep);
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border: 1.5px solid var(--green-deep);
  border-radius: 3px;
  background:
    repeating-linear-gradient(-45deg, rgba(39, 138, 76, 0.22) 0 1.2px, transparent 1.2px 4.5px),
    rgba(239, 225, 191, 0.55);
}
.hatched:hover { color: var(--ink); background-color: rgba(39, 138, 76, 0.2); }

/* ── Ciao Beppe home ───────────────────────────────────── */
.hello h1 { font-size: clamp(3rem, 11vw, 5.5rem); margin-bottom: 0.5rem; }
.hello h1::after {
  content: "";
  display: block;
  width: 5.5em;
  max-width: 100%;
  height: 0.16em;
  margin-top: 0.12em;
  background: repeating-linear-gradient(-45deg, var(--green) 0 1.5px, transparent 1.5px 5px);
  opacity: 0.8;
}
.apps { margin-top: 3rem; }
.app-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  align-items: center;
  max-width: 40rem;
  padding: 1.5rem 0;
  border-top: 1.5px solid rgba(28, 106, 58, 0.35);
}
.app-row img { width: 7rem; height: 7rem; border-radius: 1.6rem; display: block; }
.app-row h2 { margin: 0 0 0.25rem; }
.app-row p { margin: 0 0 0.5rem; }

/* ── Varco page ─────────────────────────────────────────── */
.app-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: center; }
.app-hero img { width: clamp(9rem, 26vw, 15rem); height: auto; aspect-ratio: 1; border-radius: 22.4%; display: block; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; max-width: 52rem; }
.plans h3 { margin-top: 0; }
.plan { padding-top: 1rem; border-top: 3px solid var(--green-deep); }

/* ── tables (Risorse) ───────────────────────────────────── */
.table-wrap { overflow-x: auto; max-width: 100%; margin: 0 0 1.25rem; }
table { border-collapse: collapse; font-size: 1rem; min-width: 30rem; }
th, td { text-align: left; padding: 0.35rem 1rem 0.35rem 0; border-bottom: 1px solid rgba(85, 98, 91, 0.3); }
th { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--green-deep); }
td:first-child { color: var(--ink-soft); }
.it { font-family: var(--serif); font-style: italic; font-weight: 500; }

/* ── support questions ─────────────────────────────────── */
details { max-width: var(--measure); border-top: 1px solid rgba(85, 98, 91, 0.3); padding: 0.75rem 0; }
details:last-of-type { border-bottom: 1px solid rgba(85, 98, 91, 0.3); }
summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; list-style-position: outside; }
summary::marker { color: var(--green); }
details[open] summary { margin-bottom: 0.5rem; }

/* ── footer ─────────────────────────────────────────────── */
.site-foot {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  border-top: 1px solid rgba(85, 98, 91, 0.25);
}
.site-foot a { color: var(--ink-soft); }

@media (max-width: 34rem) {
  .app-hero { grid-template-columns: 1fr; }
  .app-hero img { order: -1; }
  .app-row { grid-template-columns: 5rem 1fr; gap: 1rem; }
  .app-row img { width: 5rem; height: 5rem; border-radius: 1.15rem; }
}

/* Risorse: Italian forms in the serif italic, like the app's verb forms */
.risorse em { font-family: var(--serif); font-style: italic; font-weight: 500; }
.risorse h2 { margin-top: 3rem; }
.risorse h3 { margin-top: 2rem; }

/* Risorse contents list */
.toc { margin: 0 0 2.5rem; padding: 1rem 0 1.25rem; border-top: 1.5px solid rgba(28, 106, 58, 0.35); border-bottom: 1.5px solid rgba(28, 106, 58, 0.35); }
.risorse .toc-title { margin: 0 0 0.6rem; font-size: 1.15rem; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2 12rem; column-gap: 2rem; }
.toc li { margin: 0 0 0.35rem; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.risorse h2[id] { scroll-margin-top: 1rem; }

/* ── Varco navigation: the app's home (JF 10/22) ────────── */
/* Desktop: a left column with the menu boxes standing in a pencil archway
   (the icon above them on the Varco page); the page to the right.
   Phone: the boxes in a 2 × 2 grid above the page. */
.layout { flex: 1; width: 100%; max-width: 64rem; margin: 0 auto; padding: 2rem 1.5rem 4rem;
          display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 0 3.75rem; }
.layout main { padding: 0; max-width: none; margin: 0; min-width: 0; }
.layout h1 { margin-top: -0.35rem; }
.rail { position: sticky; top: 1.5rem; align-self: start; }
.rail .icon { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 22.4%; margin: 0 0 2.25rem; }
.boxes { position: relative; z-index: 0; display: grid; gap: 0.95rem; padding: 4.6rem 0.95rem 1.2rem; }
.boxes .arch { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; color: var(--green-deep); overflow: visible; }

/* a box like the app's: pencil lines that run just past the corners, a light hatch;
   filled with green hatching when selected */
.box { position: relative; display: block; padding: 0.5rem 0.85rem 0.55rem; font-family: var(--serif); font-style: italic;
       font-weight: 600; font-size: 1.28rem; line-height: 1.2; color: var(--green-deep); text-decoration: none;
       background: repeating-linear-gradient(-58deg, rgba(110, 96, 62, 0.16) 0 1px, transparent 1px 3.6px), rgba(239, 225, 191, 0.6); }
.box::before, .box::after { content: ""; position: absolute; pointer-events: none; border: 0 solid var(--green-deep); }
.box::before { inset: 0 -3px; border-top-width: 1.5px; border-bottom-width: 1.5px; }
.box::after  { inset: -3px 0; border-left-width: 1.5px; border-right-width: 1.5px; }
.box:hover { color: var(--ink); background-color: rgba(39, 138, 76, 0.16); }
.box[aria-current="page"], .box.on {
  color: #f4ecd6;
  background: repeating-linear-gradient(-58deg, rgba(14, 70, 36, 0.5) 0 1.2px, transparent 1.2px 3.4px), #2b7f48; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; margin: 2.5rem 0 1.75rem; max-width: 40rem; }
.gallery { max-width: none; row-gap: 2.25rem; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 1.35rem; border: 1.5px solid rgba(28, 106, 58, 0.45); background: #e3cc9a; }
.shot figcaption { font-size: 0.93rem; line-height: 1.45; color: var(--ink-soft); margin-top: 0.7rem; }

/* Grammatica: the contents work like the app's home */
.picker { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0 1.6rem; margin: 2rem 0 1rem; max-width: 36rem; }
.picker .col { display: grid; gap: 0.85rem; align-content: start; }
.picker .levels .box { font-size: 1.2rem; }
.picker .tenses + .tenses { margin-top: 0.85rem; }      /* without JavaScript, every list shows */
.picker .tenses .box { text-align: right; font-size: 1.12rem; }
.picker .tenses[hidden] { display: none; }
.picker-note { font-size: 0.93rem; color: var(--ink-soft); margin: 0 0 2.5rem; }
.risorse .level { margin: 3.5rem 0 0.25rem; font-size: 2rem; color: var(--green-deep); }
.risorse .level::after { content: ""; display: block; width: 4.5em; height: 0.2em; margin-top: 0.15em;
  background: repeating-linear-gradient(-58deg, var(--green) 0 1.4px, transparent 1.4px 4.5px); opacity: 0.75; }
.risorse h3 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.6rem; margin: 2.5rem 0 0.7rem; }
.risorse h4 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin: 1.75rem 0 0.4rem; }
.risorse [id] { scroll-margin-top: 1rem; }
.risorse td .end { color: #73551a; }                     /* the app's amber; 4.9:1 on the paper */
.back { margin: 1.25rem 0 0; font-size: 0.9rem; }
.back a { text-decoration: none; color: var(--ink-soft); }
.back a:hover { color: var(--green-deep); text-decoration: underline; }

.hero-m img { display: none; }
@media (max-width: 52rem) {
  .layout { grid-template-columns: 1fr; padding-top: 1rem; }
  .rail { position: static; }
  .rail .icon { display: none; }
  .boxes { grid-template-columns: 1fr 1fr; gap: 0.7rem 0.9rem; padding: 0.4rem 0.3rem 0; margin-bottom: 2.25rem; }
  .boxes .arch { display: none; }
  .box { font-size: 1.08rem; padding: 0.42rem 0.7rem; }
  .hero-m { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
  .hero-m img { display: block; width: 4.5rem; height: 4.5rem; border-radius: 22.4%; }
  .hero-m h1 { margin: 0; }
  .shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; margin-right: -1.5rem; padding: 0 1.5rem 0.5rem 0; }
  .shot { flex: 0 0 62%; scroll-snap-align: start; }
  .picker { gap: 0 1rem; }
  .picker .levels .box { font-size: 1.02rem; }
  .picker .tenses .box { font-size: 0.98rem; }
}

.plan-note { margin: 0.4rem 0 0.2rem; font-size: 0.95rem; color: var(--ink-soft); }

/* Credits: the open-source notices (JF 11/06) */
.credits-table table { font-size: 0.9rem; }
.credits-table td:first-child { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--ink); }
pre.licence { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem; line-height: 1.5; color: var(--ink-soft); background: rgba(239, 225, 191, 0.55); padding: 0.9rem 1rem; margin: 0.6rem 0 1rem; }
.licences summary { font-family: var(--sans); font-weight: 600; font-size: 0.92rem; line-height: 1.45; }
/* Credits: the two outer fold-outs (Packages, Licence texts) */
details.fold { margin: 1rem 0; border-top: 1.5px solid rgba(28, 106, 58, 0.45); }
details.fold > summary { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.3rem; color: var(--green-deep); padding: 0.75rem 0; }
details.fold[open] > summary { margin-bottom: 0.5rem; }
