/* Arcadia:Design — Applicazioni. Tokens follow the brand book:
   gold #e1ac51 as the single accent, warm grey #736d68, carbon #333, white. */
:root {
  --ground: #171614;
  --surface: #1f1d1b;
  --surface-2: #282522;
  --hair: rgba(255, 255, 255, .09);
  --hair-2: rgba(255, 255, 255, .18);
  --text: #f1ede6;
  --dim: #a8a29b;
  --faint: #736d68;
  --accent: #e1ac51;
  --accent-ink: #1a1408;
  --glow: rgba(225, 172, 81, .10);
  --shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
  --grain: .05;
  --font: "Tenor Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ground: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #ececea;
  --hair: rgba(0, 0, 0, .10);
  --hair-2: rgba(0, 0, 0, .20);
  --text: #333333;
  --dim: #5c5751;
  --faint: #736d68;
  --accent: #b9812a;
  --accent-ink: #ffffff;
  --glow: rgba(185, 129, 42, .10);
  --shadow: 0 40px 90px -34px rgba(51, 40, 20, .35);
  --grain: .035;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 var(--font);
  color: var(--text);
  background: var(--ground);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; }
.colon { color: var(--accent); }
svg.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- page shell ---------- */
.page { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 40px 56px; }
.glow {
  position: absolute; inset: 0 0 auto 0; height: 760px; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 70% at 18% 0%, var(--glow), transparent 70%);
}
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 30px 0 0; position: relative; z-index: 2; }
.wordmark { font-size: 22px; letter-spacing: .01em; text-decoration: none; }
.wordmark small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-left: 12px; }
.theme {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; background: transparent;
  border: 1px solid var(--hair-2); border-radius: 999px; padding: 8px 15px 8px 12px; color: var(--dim);
  transition: border-color .2s, color .2s;
}
.theme:hover { border-color: var(--accent); color: var(--text); }
.theme .ic { font-size: 16px; color: var(--accent); }

.hero { position: relative; padding: 78px 0 64px; }
.gear { position: absolute; right: -120px; top: 6px; width: 520px; height: 520px; opacity: .1; color: var(--accent); pointer-events: none; animation: spin 180s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { color: var(--faint); display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
h1 { font-weight: 400; font-size: clamp(42px, 6.4vw, 84px); line-height: 1.02; letter-spacing: -.015em; margin: 22px 0 26px; max-width: 12ch; position: relative; }
h1 em { font-style: normal; color: var(--accent); }
.lede { max-width: 56ch; color: var(--dim); font-size: 18px; line-height: 1.6; margin: 0; position: relative; }
.lede b { font-weight: 400; color: var(--text); }
.meta { display: flex; gap: 36px; margin-top: 40px; position: relative; flex-wrap: wrap; }
.meta div { border-left: 1px solid var(--hair-2); padding-left: 14px; }
.meta strong { display: block; font-weight: 400; font-size: 30px; line-height: 1.1; }
.meta span { color: var(--faint); }

/* ---------- tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; z-index: 1; }
.tile {
  --lift: 0px;
  position: relative; display: flex; flex-direction: column; text-align: left; cursor: pointer;
  padding: 26px 26px 22px; border-radius: 20px; border: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 82%, var(--ground)));
  overflow: hidden; transform: translateY(var(--lift));
  transition: border-color .25s, transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}
.tile:hover, .tile:focus-visible { border-color: var(--accent); --lift: -4px; box-shadow: var(--shadow); }
.tile.flagship { grid-column: span 2; display: grid; grid-template-columns: 1.05fr 1fr; gap: 0 34px; align-items: stretch; }
.tile.flagship .tile-head, .tile.flagship .tile-body, .tile.flagship .tile-foot { grid-column: 1; }
.tile.flagship .shot { grid-column: 2; grid-row: 1 / span 3; margin: 0; aspect-ratio: auto; height: 100%; min-height: 260px; }
.tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; color: var(--accent);
  border: 1px solid var(--hair-2); background: radial-gradient(120% 120% at 20% 0%, var(--glow), transparent 70%), var(--ground);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), background .25s, color .25s;
}
.tile:hover .icon, .tile:focus-visible .icon { transform: rotate(-6deg) scale(1.06); background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.idx { color: var(--faint); }
.tile h2 { font-weight: 400; font-size: 29px; line-height: 1.1; margin: 0 0 6px; letter-spacing: -.005em; }
.tile.flagship h2 { font-size: 36px; }
.kind { color: var(--accent); margin-bottom: 14px; display: block; }
.tile p { margin: 0; color: var(--dim); font-size: 15px; line-height: 1.55; }
.shot { margin: 22px 0 18px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 1px solid var(--hair); background: var(--ground); position: relative; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; filter: saturate(.85) brightness(.92); transition: transform .8s cubic-bezier(.2, .7, .2, 1), filter .4s; }
.tile:hover .shot img { transform: scale(1.045); filter: none; }
.shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--surface) 70%, transparent)); pointer-events: none; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; color: var(--faint); }
.tile-foot .go { display: inline-flex; align-items: center; gap: 8px; color: var(--text); transition: gap .25s, color .25s; }
.tile:hover .go { gap: 14px; color: var(--accent); }
.tile.flagship .tile-body { align-self: start; }
.tile.flagship .tile-foot { align-self: end; }

.foot { position: relative; z-index: 1; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--faint); }
.foot kbd { font: inherit; border: 1px solid var(--hair-2); border-radius: 5px; padding: 1px 6px; margin: 0 2px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 80ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.tile.reveal { animation-name: rise; }

/* ---------- viewer ---------- */
dialog.viewer {
  padding: 0; border: 1px solid var(--hair-2); border-radius: 22px; background: var(--ground); color: var(--text);
  width: min(1520px, 97vw); height: min(940px, 94vh); max-width: none; max-height: none; box-shadow: var(--shadow); overflow: hidden;
}
dialog.viewer[open] { display: grid; grid-template-rows: auto 1fr; animation: pop .35s cubic-bezier(.2, .7, .2, 1); }
dialog.viewer::backdrop { background: rgba(8, 7, 6, .72); backdrop-filter: blur(10px); animation: fade .3s; }
:root[data-theme="light"] dialog.viewer::backdrop { background: rgba(60, 52, 40, .5); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }
.v-top { display: flex; align-items: center; gap: 18px; padding: 14px 18px 14px 22px; border-bottom: 1px solid var(--hair); background: var(--surface); }
.v-id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.v-id .icon { width: 42px; height: 42px; font-size: 21px; border-radius: 12px; }
.v-id b { font-weight: 400; font-size: 19px; white-space: nowrap; }
.tabs { display: flex; gap: 6px; margin: 0 auto; padding: 4px; border: 1px solid var(--hair); border-radius: 999px; background: var(--ground); }
.tab { background: transparent; border: 0; cursor: pointer; padding: 8px 18px; border-radius: 999px; color: var(--dim); transition: background .2s, color .2s; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.v-nav { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--hair-2); background: transparent; border-radius: 12px; padding: 10px 15px; color: var(--text);
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.sq { width: 40px; height: 40px; padding: 0; font-size: 18px; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pri:hover { background: transparent; color: var(--accent); }
.v-body { display: grid; grid-template-columns: 360px 1fr; min-height: 0; }
.v-side { padding: 28px 26px 26px 28px; overflow: auto; border-right: 1px solid var(--hair); display: flex; flex-direction: column; gap: 22px; background: color-mix(in srgb, var(--surface) 60%, var(--ground)); }
.v-side h3 { font-weight: 400; font-size: 34px; line-height: 1.08; margin: 8px 0 0; letter-spacing: -.01em; }
.v-side .desc { color: var(--dim); margin: 0; }
.caps-h { color: var(--faint); margin-bottom: 4px; }
.caps { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.caps li { counter-increment: c; display: grid; grid-template-columns: 34px 1fr; gap: 4px; padding: 13px 0; border-top: 1px solid var(--hair); }
.caps li::before { content: counter(c, decimal-leading-zero); font-family: var(--mono); font-size: 11.5px; color: var(--accent); padding-top: 4px; }
.caps b { display: block; font-weight: 400; font-size: 17px; line-height: 1.3; margin-bottom: 3px; }
.caps span { display: block; color: var(--dim); font-size: 14px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--hair-2); border-radius: 999px; padding: 4px 11px; color: var(--dim); }
.v-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.v-stage { position: relative; min-width: 0; min-height: 0; background: var(--ground); display: grid; }
.panel { position: relative; min-height: 0; display: none; }
.panel.on { display: block; animation: fade .35s; }
.slot { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; }
.slot .media { max-width: 100%; max-height: 100%; border-radius: 14px; border: 1px solid var(--hair-2); box-shadow: var(--shadow); background: var(--surface); display: block; }
.slot iframe.media { width: 100%; height: 100%; background: var(--ground); }
.slot .media[hidden] { display: none; }
.skeleton { position: absolute; inset: 22px; border-radius: 14px; border: 1px solid var(--hair); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; display: grid; place-items: center; color: var(--faint); }
@keyframes shimmer { to { background-position: -220% 0; } }
.err { position: absolute; inset: 22px; border-radius: 14px; border: 1px dashed var(--hair-2); display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; padding: 30px; color: var(--dim); }
.err b { font-weight: 400; color: var(--text); font-size: 19px; }
.slides { position: absolute; inset: 0; overflow: auto; padding: 22px; scroll-snap-type: y proximity; }
.slides figure { margin: 0 auto 22px; max-width: 760px; scroll-snap-align: start; position: relative; }
.slides img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--hair-2); box-shadow: var(--shadow); background: var(--surface); }
.slides figcaption { position: absolute; top: 12px; right: 12px; background: var(--ground); border: 1px solid var(--hair-2); border-radius: 999px; padding: 3px 10px; color: var(--dim); }
.scrollhint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); color: var(--faint); pointer-events: none; background: color-mix(in srgb, var(--ground) 80%, transparent); padding: 5px 12px; border-radius: 999px; border: 1px solid var(--hair); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tile.flagship { grid-column: span 2; }
  .v-body { grid-template-columns: 310px 1fr; }
  .v-id b { display: none; }
}
@media (max-width: 760px) {
  .page { padding: 0 20px 40px; }
  .hero { padding: 54px 0 44px; }
  .gear { width: 340px; height: 340px; right: -150px; }
  .grid { grid-template-columns: 1fr; }
  .tile.flagship { grid-column: auto; display: flex; }
  .tile.flagship .shot { margin: 22px 0 18px; aspect-ratio: 16 / 10; min-height: 0; height: auto; }
  dialog.viewer { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .v-top { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .tabs { order: 3; width: 100%; margin: 0; justify-content: center; }
  .v-nav { margin-left: auto; }
  .v-body { display: flex; flex-direction: column; overflow: auto; }
  .v-stage { order: -1; flex: none; height: 46vh; min-height: 240px; }
  .v-side { flex: none; border-right: 0; border-top: 1px solid var(--hair); overflow: visible; }
  .slot { padding: 10px; }
  .skeleton, .err { inset: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .gear { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- liquid glass layer ---------- */
:root {
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .09);
  --glass-edge: rgba(255, 255, 255, .22);
  --glass-edge-low: rgba(255, 255, 255, .04);
  --glass-blur: blur(26px) saturate(170%);
  --spec: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(255, 255, 255, .05), inset 0 0 22px rgba(255, 255, 255, .035);
}
:root[data-theme="light"] {
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .95);
  --glass-edge-low: rgba(255, 255, 255, .3);
  --spec: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(0, 0, 0, .04), inset 0 0 22px rgba(255, 255, 255, .5);
}
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.ambient i:nth-child(1) { width: 520px; height: 520px; left: -8%; top: 4%; background: #e1ac51; opacity: .32; }
.ambient i:nth-child(2) { width: 460px; height: 460px; right: -6%; top: 22%; background: #8a5a2b; animation-delay: -9s; }
.ambient i:nth-child(3) { width: 600px; height: 600px; left: 28%; bottom: -22%; background: #736d68; opacity: .4; animation-delay: -16s; }
.ambient i:nth-child(4) { width: 300px; height: 300px; right: 24%; bottom: 8%; background: #e1ac51; opacity: .18; animation-delay: -5s; }
:root[data-theme="light"] .ambient i { opacity: .38; }
:root[data-theme="light"] .ambient i:nth-child(3) { opacity: .22; }
@keyframes drift { to { transform: translate(90px, -60px) scale(1.18); } }

.tile, .theme, .tabs, .btn, .chip, .v-top, .v-side, .scrollhint, .slides figcaption, .meta div {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.tile {
  background: linear-gradient(145deg, var(--glass-strong), var(--glass) 55%, var(--glass-edge-low));
  border: 1px solid var(--glass-edge-low);
  box-shadow: var(--spec), 0 22px 50px -28px rgba(0, 0, 0, .65);
}
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 20%) var(--my, 0%), rgba(255, 255, 255, .16), transparent 55%);
  opacity: 0; transition: opacity .3s;
}
:root[data-theme="light"] .tile::before { background: radial-gradient(420px circle at var(--mx, 20%) var(--my, 0%), rgba(255, 255, 255, .9), transparent 55%); }
.tile:hover::before, .tile:focus-visible::before { opacity: 1; }
.tile > * { position: relative; }
.tile:hover, .tile:focus-visible { border-color: var(--glass-edge); box-shadow: var(--spec), 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow); }
.icon {
  background: linear-gradient(145deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-edge-low); box-shadow: var(--spec), 0 10px 24px -12px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.tile:hover .icon, .tile:focus-visible .icon { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent)); box-shadow: var(--spec), 0 14px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.shot { border-color: var(--glass-edge-low); box-shadow: var(--spec); }
.theme, .btn, .chip, .tabs { background: var(--glass); border-color: var(--glass-edge-low); box-shadow: var(--spec); }
.btn:hover, .theme:hover { background: var(--glass-strong); }
.btn.pri { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); box-shadow: var(--spec); }
.btn.pri:hover { background: var(--glass-strong); }
.meta div { border: 1px solid var(--glass-edge-low); border-radius: 16px; padding: 12px 18px; background: var(--glass); box-shadow: var(--spec); }
.tab[aria-selected="true"] { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); box-shadow: var(--spec), 0 6px 18px -8px var(--accent); }
dialog.viewer {
  background: color-mix(in srgb, var(--ground) 62%, transparent);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-edge-low); box-shadow: var(--spec), 0 50px 120px -30px rgba(0, 0, 0, .85);
}
.v-top { background: var(--glass); }
.v-side { background: var(--glass); }
.v-stage { background: transparent; }
.skeleton { border-color: var(--glass-edge-low); }
.slot .media, .slides img { border-color: var(--glass-edge-low); }
.foot { border-top-color: var(--glass-edge-low); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tile, dialog.viewer { background: var(--surface); }
}
@media (prefers-reduced-motion: reduce) { .ambient i { animation: none; } }
