/* ==========================================================================
   Egyptian B Foot — core.css
   Fondamenta condivise: variabili, tipografia, atmosfera, controlli.
   Palette: nero ossidiana, antracite, pietra, oro satinato, ambra, bronzo,
   rame, avorio caldo. Accenti molto controllati di borgogna e rubino.
   ========================================================================== */

:root {
  /* --- fondi ------------------------------------------------------------ */
  --pitch: #060504;
  --obsidian: #0a0806;
  --anthracite: #15110d;
  --stone: #241c15;
  --stone-lit: #33271c;
  --smoke: rgba(24, 19, 14, 0.58);

  /* --- metalli ---------------------------------------------------------- */
  --gold: #d8b46a;
  --gold-lit: #f0cd8a;
  --gold-pale: #fbf0d2;
  --amber: #e0913c;
  --bronze: #9d6f3a;
  --copper: #b96f45;

  /* --- chiari e accenti ------------------------------------------------- */
  --ivory: #f4ead8;
  --ivory-2: rgba(244, 234, 216, 0.68);
  --ivory-3: rgba(244, 234, 216, 0.44);
  --burgundy: #4a1220;
  --ruby: #7d1b2a;

  /* --- linee e vetro ---------------------------------------------------- */
  --hair: rgba(216, 180, 106, 0.16);
  --hair-lit: rgba(240, 205, 138, 0.34);
  --glass: rgba(21, 17, 13, 0.62);
  --glass-2: rgba(36, 28, 21, 0.46);

  /* --- tipografia ------------------------------------------------------- */
  --display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --ui: "Jost", "Futura", "Avenir Next", sans-serif;

  --track-wide: 0.34em;
  --track-mid: 0.18em;

  /* --- ritmo ------------------------------------------------------------ */
  --gut: clamp(1.25rem, 4vw, 3.25rem);
  --rail: clamp(1.15rem, 5vw, 5.5rem);
  --max: 1560px;
  --radius: 26px;
  --radius-s: 16px;

  /* --- curve ------------------------------------------------------------ */
  --ease: cubic-bezier(0.16, 0.84, 0.28, 1);
  --ease-soft: cubic-bezier(0.4, 0.01, 0.2, 1);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--ui);
  font-weight: 300;
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.09rem);
  line-height: 1.66;
  color: var(--ivory-2);
  background-color: var(--obsidian);
  /* Profondità cromatica: mai "nero pieno + scritte oro". */
  background-image:
    radial-gradient(120% 80% at 82% -8%, rgba(224, 145, 60, 0.16), transparent 62%),
    radial-gradient(90% 60% at 6% 12%, rgba(122, 66, 28, 0.14), transparent 58%),
    radial-gradient(140% 100% at 50% 118%, rgba(74, 18, 32, 0.2), transparent 64%),
    linear-gradient(178deg, #0b0907 0%, #120e0a 38%, #0a0806 72%, #070504 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body.isLocked {
  overflow: hidden;
}

/* Grana cinematografica: overlay fisso, non interattivo, fuori dallo scroll. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(216, 180, 106, 0.26);
  color: var(--gold-pale);
}

:focus-visible {
  outline: 1px solid var(--gold-lit);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- tipografia */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--ivory);
  letter-spacing: -0.014em;
  line-height: 1.02;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.7rem, 1.4rem + 6.4vw, 7.4rem);
}

h2 {
  font-size: clamp(2.05rem, 1.2rem + 3.6vw, 4.5rem);
}

h3 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem);
}

p {
  margin: 0 0 1.1em;
}

em {
  font-style: italic;
  color: var(--gold-lit);
}

/* Filetto d'occhiello: tono editoriale, mai grassetto pesante. */
.overline {
  margin: 0;
  font-size: clamp(0.6rem, 0.56rem + 0.16vw, 0.7rem);
  font-weight: 400;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.85em;
}

.overline::before {
  content: "";
  width: clamp(18px, 4vw, 46px);
  height: 1px;
  flex: none;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.overline--plain::before {
  display: none;
}

.lede {
  font-size: clamp(1.02rem, 0.96rem + 0.4vw, 1.28rem);
  line-height: 1.62;
  color: var(--ivory-2);
  max-width: 46ch;
}

.tiny {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ivory-3);
  line-height: 1.5;
}

.gilded {
  background: linear-gradient(96deg, var(--gold-pale) 4%, var(--gold-lit) 32%, var(--bronze) 76%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------ marchio */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  min-width: 0;
}

/*
   Il marchio non è "incollato": alone ambientale, riflesso metallico e ombra
   morbida lo fondono con lo sfondo.
*/
.brandMark {
  position: relative;
  width: var(--markSize, 36px);
  height: var(--markSize, 36px);
  flex: none;
  filter: drop-shadow(0 2px 10px rgba(224, 145, 60, 0.34))
    drop-shadow(0 0 26px rgba(216, 180, 106, 0.14));
  transition: filter 0.6s var(--ease), transform 0.6s var(--ease);
}

.brandMark::before {
  content: "";
  position: absolute;
  inset: -42%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 145, 60, 0.24), transparent 66%);
  opacity: 0.8;
  pointer-events: none;
}

.brandMark img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand:hover .brandMark {
  transform: translateY(-1px);
  filter: drop-shadow(0 3px 14px rgba(240, 205, 138, 0.5))
    drop-shadow(0 0 34px rgba(216, 180, 106, 0.24));
}

.brandName {
  display: block;
  font-family: var(--display);
  font-size: clamp(0.72rem, 0.68rem + 0.2vw, 0.86rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory);
  white-space: nowrap;
}

.brandName small {
  display: block;
  font-family: var(--ui);
  font-size: 0.56rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  color: var(--gold);
  opacity: 0.78;
  margin-top: 0.24em;
}

/* ----------------------------------------------------------------- pulsanti */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: 1.02em 1.9em;
  border-radius: 999px;
  font-size: clamp(0.68rem, 0.64rem + 0.16vw, 0.78rem);
  font-weight: 400;
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
    color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

/* Riflesso metallico che attraversa il pulsante al passaggio del puntatore. */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 22%,
    rgba(255, 252, 240, 0.42) 46%,
    transparent 62%
  );
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}

.btn:hover::after,
.btn:focus-visible::after {
  transform: translateX(120%);
}

.btn--gold {
  color: #23180c;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.42), transparent 46%),
    linear-gradient(96deg, #f3d69a 0%, #e0b56c 34%, #c99a4f 68%, #e6c586 100%);
  box-shadow:
    0 1px 0 rgba(255, 250, 235, 0.55) inset,
    0 -1px 0 rgba(90, 58, 20, 0.4) inset,
    0 12px 34px -14px rgba(224, 145, 60, 0.72),
    0 2px 10px rgba(0, 0, 0, 0.4);
}

.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 250, 235, 0.7) inset,
    0 -1px 0 rgba(90, 58, 20, 0.4) inset,
    0 18px 44px -14px rgba(240, 205, 138, 0.8),
    0 3px 14px rgba(0, 0, 0, 0.42);
}

.btn--ghost {
  color: var(--ivory);
  border: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(244, 234, 216, 0.05), rgba(10, 8, 6, 0.2));
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.btn--ghost:hover {
  color: var(--gold-pale);
  border-color: var(--hair-lit);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.9);
}

.btn--quiet {
  padding: 0.7em 1.2em;
  color: var(--ivory-2);
  border: 1px solid rgba(244, 234, 216, 0.12);
  border-radius: 999px;
}

.btn--quiet:hover {
  color: var(--gold-lit);
  border-color: var(--hair-lit);
}

.btn--wide {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
}

/* Testo-collegamento con filetto che si estende: nessun sottolineato standard. */
.inkLink {
  position: relative;
  display: inline-block;
  color: var(--gold-lit);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.inkLink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0.42;
  transform: scaleX(0.24);
  transform-origin: left;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}

.inkLink:hover::after {
  transform: scaleX(1);
  opacity: 0.9;
}

/* ----------------------------------------------------- occhio di Horus (chiave) */

.horusKey {
  --horusSize: 30px;
  width: var(--horusSize);
  height: calc(var(--horusSize) * 0.72);
  flex: none;
  color: var(--gold);
  filter: drop-shadow(0 0 0 rgba(240, 205, 138, 0));
  transition: color 0.5s var(--ease), filter 0.6s var(--ease), transform 0.6s var(--ease);
}

.horusKey path,
.horusKey circle {
  vector-effect: non-scaling-stroke;
}

a:hover .horusKey,
button:hover .horusKey,
.horusKey:hover,
.horusKey.isLit {
  color: var(--gold-pale);
  transform: translateY(-1px);
  filter: drop-shadow(0 0 12px rgba(240, 205, 138, 0.75))
    drop-shadow(0 0 30px rgba(224, 145, 60, 0.45));
}

/* --------------------------------------------------------------- superficie */

/* Vetro fumé: base di tutti i pannelli. */
.pane {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--hair);
  background:
    linear-gradient(168deg, rgba(244, 234, 216, 0.055), rgba(6, 5, 4, 0.42) 62%),
    var(--glass);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  box-shadow:
    0 1px 0 rgba(244, 234, 216, 0.07) inset,
    0 40px 90px -50px rgba(0, 0, 0, 0.95);
}

/* Filetto luminoso sul bordo superiore: luce ambientale che scivola. */
.pane::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(240, 205, 138, 0.5) 22%,
    rgba(244, 234, 216, 0.28) 50%,
    rgba(240, 205, 138, 0.42) 78%,
    transparent
  );
  pointer-events: none;
}

.shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--rail);
}

.section {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 10.5rem);
}

/* --------------------------------------------------------------- rivelazioni */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease-soft),
    filter 1.1s var(--ease-soft);
  filter: blur(6px);
  will-change: opacity, transform;
}

[data-reveal].isIn {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-reveal="slow"] {
  transition-duration: 1.6s;
}

/* -------------------------------------------------------------------- forme */

.formField {
  display: block;
  margin-bottom: 1.05rem;
}

.formField > span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.64rem;
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  color: var(--gold);
}

.formField input,
.formField select,
.formField textarea {
  width: 100%;
  padding: 0.92rem 1.05rem;
  border: 1px solid rgba(244, 234, 216, 0.13);
  border-radius: 14px;
  background: rgba(6, 5, 4, 0.5);
  color: var(--ivory);
  font-size: 0.98rem;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease),
    background 0.4s var(--ease);
}

.formField textarea {
  min-height: 96px;
  resize: vertical;
}

.formField input:focus,
.formField select:focus,
.formField textarea:focus {
  outline: none;
  border-color: var(--hair-lit);
  background: rgba(12, 9, 7, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.12);
}

.formField input::placeholder,
.formField textarea::placeholder {
  color: rgba(244, 234, 216, 0.28);
}

.formField--bad input {
  border-color: rgba(160, 46, 62, 0.75);
  box-shadow: 0 0 0 3px rgba(125, 27, 42, 0.16);
}

.fieldNote {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ivory-3);
}

.fieldNote--bad {
  color: #e3a2ab;
}

/* Casella di conferma disegnata: nessun controllo di sistema. */
.check {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ivory-2);
  cursor: pointer;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check i {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid rgba(244, 234, 216, 0.24);
  border-radius: 7px;
  background: rgba(6, 5, 4, 0.55);
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.check i::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 8px;
  height: 4px;
  border-left: 1.6px solid #23180c;
  border-bottom: 1.6px solid #23180c;
  transform: rotate(-45deg) scale(0.4);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.check input:checked + i {
  border-color: transparent;
  background: linear-gradient(140deg, #f3d69a, #c99a4f);
  box-shadow: 0 6px 18px -8px rgba(224, 145, 60, 0.9);
}

.check input:checked + i::after {
  transform: rotate(-45deg) scale(1);
  opacity: 1;
}

.check input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.28);
}

/* --------------------------------------------------------------- messaggi */

.notice {
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: rgba(36, 28, 21, 0.5);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ivory-2);
}

.notice--bad {
  border-color: rgba(160, 46, 62, 0.5);
  background: rgba(74, 18, 32, 0.34);
  color: #f0c8ce;
}

.notice--good {
  border-color: rgba(216, 180, 106, 0.4);
  background: rgba(60, 44, 24, 0.4);
  color: var(--gold-pale);
}

.notice--warn {
  border-color: rgba(224, 145, 60, 0.42);
  background: rgba(70, 44, 18, 0.4);
  color: #f2d3a6;
}

.notice--info {
  border-color: rgba(244, 234, 216, 0.14);
  background: rgba(24, 19, 14, 0.6);
}

.notice code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92em;
  letter-spacing: 0.02em;
  color: var(--gold-lit);
}

.notice[hidden] {
  display: none;
}

/* Scheletro di caricamento: segue la forma del contenuto, mai una rotella. */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, rgba(36, 28, 21, 0.62), rgba(10, 8, 6, 0.5));
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(216, 180, 106, 0.11) 48%,
    transparent 74%
  );
  transform: translateX(-100%);
  animation: sheen 1.9s var(--ease-soft) infinite;
}

@keyframes sheen {
  to {
    transform: translateX(100%);
  }
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------- movimento ridotto */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
