/* Kemudo Tech: foglio di stile condiviso */

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/unbounded-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: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/unbounded-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: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/archivo-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: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/archivo-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: "Martian Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/martian-mono-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;
}

:root {
  --bg: #0b0c0f;
  --bg-2: #121318;
  --bg-3: #191a20;
  --ink: #ecebe6;
  --ink-2: #b9bac0;
  --mute: #8c8e96;
  --line: rgba(236, 235, 230, 0.12);
  --line-2: rgba(236, 235, 230, 0.22);

  /* colori delle app */
  --mint: #8fe3c8;

  --f-display: "Unbounded", "Archivo", system-ui, sans-serif;
  --f-text: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --pad: clamp(20px, 4.5vw, 64px);
  --max: 1320px;

  color-scheme: dark;
  accent-color: var(--ink);
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: #3a3b42 var(--bg); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

/* trama a puntini, usata come fondo di alcune zone */
.grid-dots {
  background-image: radial-gradient(rgba(236, 235, 230, 0.075) 1px, transparent 1.2px);
  background-size: 24px 24px;
  background-position: -12px -12px;
}

/* ---------- barra in alto ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.top.is-stuck {
  background: rgba(11, 12, 15, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: var(--f-display); font-weight: 500; font-size: 15px; letter-spacing: 0.06em;
  view-transition-name: brand;
}
.brand svg { width: 34px; height: 34px; }
.brand b { font-weight: 500; }
.brand span { font-weight: 300; color: var(--ink-2); }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  text-decoration: none; font-size: 15px; color: var(--ink-2);
  padding: 8px 14px; border-radius: 999px;
  transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: var(--ink); background: var(--bg-3); }
.clock {
  font: 400 14px/1 var(--f-data); font-variant-numeric: tabular-nums;
  color: var(--ink-2); padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px;
  display: inline-flex; gap: 8px; align-items: center; white-space: nowrap;
}
.clock i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
  animation: tick 1s steps(2, jump-none) infinite;
}
@keyframes tick { 50% { opacity: 0.25; } }

/* ---------- menu per telefono ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-btn { display: none; }
.menu { display: none; }
@media (max-width: 760px) {
  .menu-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
    border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
  }
  .menu-bars { display: grid; gap: 5px; width: 16px; }
  .menu-bars i { display: block; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform 0.5s var(--ease-out); }
  .menu-open .menu-btn { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  .menu-open .menu-bars i:first-child { transform: translateY(3.25px) rotate(45deg); }
  .menu-open .menu-bars i:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .menu-open .top { background: var(--bg); border-bottom-color: var(--line); }
  .menu-open body { overflow: hidden; }

  .menu {
    display: block; position: fixed; inset: 0; z-index: 29; padding-top: 62px; overflow-y: auto;
    background:
      radial-gradient(rgba(236, 235, 230, 0.06) 1px, transparent 1.2px) -12px -12px / 24px 24px,
      var(--bg);
    clip-path: circle(0 at calc(100% - 42px) 31px); visibility: hidden;
    transition: clip-path 0.7s var(--ease-out), visibility 0s 0.7s;
  }
  .menu-open .menu { clip-path: circle(150% at calc(100% - 42px) 31px); visibility: visible; transition: clip-path 0.8s var(--ease-out), visibility 0s; }
  .menu-in { display: grid; gap: 36px; padding-block: 36px 40px; min-height: calc(100svh - 62px); align-content: start; }
  .menu-nav { display: grid; }
  .menu-nav a {
    display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line);
    font: 500 clamp(30px, 9vw, 40px)/1.05 var(--f-display); letter-spacing: -0.03em; color: var(--ink); text-decoration: none;
    opacity: 0; translate: 0 18px; filter: blur(8px);
    transition: opacity 0.3s, translate 0.3s, filter 0.3s;
  }
  .menu-nav a small { font: 400 12px/1 var(--f-data); color: var(--mute); letter-spacing: 0; }
  .menu-nav a[aria-current="page"] small { color: var(--ink); }
  .menu-open .menu-nav a {
    opacity: 1; translate: 0 0; filter: blur(0);
    transition: opacity 0.6s var(--ease-out), translate 0.8s var(--ease-out), filter 0.6s var(--ease-out);
    transition-delay: calc(0.12s + var(--i) * 0.06s);
  }
  .menu-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .menu-apps a { display: grid; justify-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-size: 13px; opacity: 0; scale: 0.8; transition: opacity 0.3s, scale 0.3s; }
  .menu-apps img { width: 56px; height: auto; border-radius: 23%; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.8); }
  .menu-open .menu-apps a { opacity: 1; scale: 1; transition: opacity 0.6s var(--ease-out), scale 0.7s var(--ease-out); transition-delay: calc(0.35s + var(--i) * 0.05s); }
  .menu-foot { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
  .menu-foot a { color: var(--ink-2); }
}
@media (max-width: 379px) {
  .clock { display: none; }
  .menu-btn { margin-left: auto; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .menu, .menu-open .menu, .menu-nav a, .menu-apps a { transition: none !important; }
}

/* ---------- pulsanti ---------- */
.btn {
  --b-bg: var(--ink); --b-fg: var(--bg);
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 16px/1 var(--f-text); text-decoration: none;
  padding: 16px 22px; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bg);
  transition: transform 0.35s var(--ease-out), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.35s var(--ease-out); }
.btn:hover svg { transform: translateY(2px); }
.btn:active { transform: scale(0.97); }
.btn.ghost { --b-bg: transparent; --b-fg: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.ghost:hover svg { transform: translateX(3px); }

/* ---------- testo ---------- */
.h-display {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(40px, 6.2vw, 92px); line-height: 1.02; letter-spacing: -0.035em;
  margin: 0; text-wrap: balance;
}
.h-2 {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(30px, 3.8vw, 54px); line-height: 1.06; letter-spacing: -0.03em;
  margin: 0; text-wrap: balance;
}
.lead { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 36em; text-wrap: pretty; }
.data { font-family: var(--f-data); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ---------- piè di pagina ---------- */
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--mute); font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; }
.foot .brand { color: var(--ink); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { text-decoration: none; color: var(--ink-2); }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.foot small { margin-left: auto; font-size: 14px; }

/* ---------- transizioni tra pagine ---------- */
::view-transition-old(root) { animation: 0.32s var(--ease-io) both vt-out; }
::view-transition-new(root) { animation: 0.5s var(--ease-out) 0.08s both vt-in; }
@keyframes vt-out { to { opacity: 0; filter: blur(8px); transform: scale(0.985); } }
@keyframes vt-in { from { opacity: 0; filter: blur(10px); transform: translateY(18px); } }
::view-transition-group(*) { animation-duration: 0.55s; animation-timing-function: var(--ease-out); }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .top .wrap { height: 62px; gap: 12px; }
  .nav { display: none; }
  .clock { margin-left: auto; font-size: 12px; padding: 8px 10px; gap: 6px; }
  .brand { font-size: 13px; gap: 10px; letter-spacing: 0.04em; white-space: nowrap; }
  .brand svg { width: 30px; height: 30px; }
  .foot small { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
