/* =========================================================================
   Svegliati — a boutique AI studio
   Concept: the scroll is a sunrise. The page opens in pre-dawn night and
   brightens, section by section, into full daylight by the contact call.
   ========================================================================= */

:root {
  /* Dawn sky — named for the hours it passes through */
  --notte:      #0A0E27; /* night indigo */
  --prugna:     #3B2A63; /* twilight plum */
  --aurora:     #FF8A6B; /* dawn coral */
  --oro:        #FFC15E; /* sun gold */
  --nebbia:     #F7F1E8; /* warm daylight cream */
  --inchiostro: #241536; /* ink for text on light */
  --stella:     #9A94C4; /* dim lavender for text on dark */
  --terra:      #6a4636; /* muted warm brown for text on light */

  /* Type */
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --pad-y: clamp(5.5rem, 13vh, 10rem);
  --radius: 18px;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  color: var(--nebbia);
  background: var(--notte);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

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

::selection { background: var(--oro); color: var(--notte); }

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--oro); color: var(--notte); padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px; font-family: var(--mono); font-size: 0.8rem; z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 3px;
  border-radius: 4px;
}
.section--light :focus-visible { outline-color: var(--inchiostro); }

/* ---------------------------------------------------------------- Typography */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oro);
  margin: 0 0 1.4rem;
}
.section--light .eyebrow { color: #b8582f; }

h1, h2, h3 { font-weight: 400; margin: 0; }

h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.3rem + 3.4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------- Nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease; }
.nav.is-scrolled {
  background: rgba(10, 14, 39, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 1.1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--serif); font-size: 1.4rem; letter-spacing: 0.01em; color: var(--nebbia);
}
.wordmark__mark {
  width: 0.85em; height: 0.85em; border-radius: 50%;
  background: radial-gradient(circle at 50% 65%, var(--oro), var(--aurora) 60%, transparent 72%),
              conic-gradient(from 180deg, transparent 0deg, rgba(255,193,94,0.25) 180deg, transparent 360deg);
  box-shadow: 0 0 14px rgba(255, 176, 94, 0.7);
  flex: none;
}
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.2rem); font-size: 0.9rem; }
.nav__links > a { color: var(--stella); transition: color 0.2s ease; }
.nav__links > a:hover { color: var(--nebbia); }
.nav__cta {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em;
  padding: 0.5rem 1rem; border: 1px solid rgba(255, 193, 94, 0.5); border-radius: 999px;
  color: var(--oro) !important;
}
.nav__cta:hover { background: rgba(255, 193, 94, 0.12); }
@media (max-width: 620px) {
  .nav__links > a:not(.nav__cta) { display: none; }
}

/* ----------------------------------------------------------------- Sections */
.section { position: relative; padding-block: var(--pad-y); }
.section--dark { color: var(--nebbia); }
.section--light { color: var(--inchiostro); }

.section__head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__head h2 { margin-top: 0.4rem; }

/* Each section paints its own slice of sky; tops and bottoms are matched so
   the whole page reads as one continuous dawn. */
.hero    { background: linear-gradient(180deg, #05060f 0%, var(--notte) 52%, #171236 100%); }
.idea    { background: linear-gradient(180deg, #171236 0%, #241a47 55%, #2f2255 100%); }
.work    { background: linear-gradient(180deg, #2f2255 0%, var(--prugna) 48%, #5b3565 100%); }
.process { background: linear-gradient(180deg, #7a3a5e 0%, #d9605f 13%, var(--aurora) 27%, #ff9d63 66%, #ffb457 100%); }
.why     { background: linear-gradient(180deg, #ffb457 0%, var(--oro) 52%, #ffce7a 100%); }
.contact { background: linear-gradient(180deg, #ffce7a 0%, #ffe0a8 42%, var(--nebbia) 100%); }
.footer  { background: linear-gradient(180deg, var(--nebbia) 0%, #efe6d6 100%); }

/* Warm-band muted text */
.section--light .step__body,
.section--light .promise p,
.section--light .contact__body { color: var(--terra); }

/* --------------------------------------------------------------------- Hero */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: max(var(--pad-y), 8rem);
  overflow: hidden;
}
.hero__content { position: relative; z-index: 2; max-width: 52rem; }

/* First light rising at the horizon */
.hero__glow {
  position: absolute; left: 50%; bottom: -34vh; z-index: 1;
  width: 130vw; height: 80vh; transform: translateX(-50%);
  background: radial-gradient(ellipse 60% 60% at 50% 100%,
    rgba(255, 197, 110, 0.55) 0%,
    rgba(255, 138, 107, 0.38) 34%,
    rgba(123, 63, 107, 0.18) 60%,
    transparent 78%);
  filter: blur(6px);
  mix-blend-mode: screen;
  pointer-events: none;
}
.hero__stars {
  position: absolute; inset: 0 0 40% 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 20%, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 14%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 34% 32%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1.3px 1.3px at 62% 26%, rgba(255,255,255,0.75), transparent 60%),
    radial-gradient(1px 1px at 88% 34%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 22% 8%, rgba(255,255,255,0.55), transparent 60%);
  opacity: 0.8;
}

.hero__title {
  font-family: var(--serif);
  font-size: clamp(4.5rem, 15vw, 12rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0.2em 0 0.28em;
}
.hero__dot { color: var(--oro); }
.hero__lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.9rem);
  line-height: 1.15;
  margin: 0 0 1.3rem;
  max-width: 22ch;
}
.hero__lede em { font-style: italic; }
.hero__thesis { color: #cfc9ea; max-width: 46ch; margin: 0 0 2.4rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
@media (max-width: 460px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}

.scroll-cue {
  position: absolute; left: var(--gutter); bottom: clamp(1.5rem, 4vh, 2.5rem); z-index: 2;
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--stella);
}
.scroll-cue__arrow { width: 1px; height: 34px; background: linear-gradient(var(--stella), transparent); position: relative; }
.scroll-cue__arrow::after {
  content: ""; position: absolute; left: -2.5px; bottom: 0; width: 6px; height: 6px;
  border-right: 1px solid var(--stella); border-bottom: 1px solid var(--stella); transform: rotate(45deg);
}

/* --------------------------------------------------------------------- Idea */
.idea__grid { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 5rem); align-items: start; }
.idea__grid .eyebrow { margin: 0.5rem 0 0; }
.idea__body { max-width: 40rem; }
.idea__body h2 { margin-bottom: 1.5rem; }
.idea__body p { color: #cfc9ea; margin: 0 0 1.2rem; }
.idea__body p:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .idea__grid { grid-template-columns: 1fr; }
  .idea__grid .eyebrow { margin: 0 0 1.2rem; }
}

/* ------------------------------------------------------------- Capabilities */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(clamp(240px, 30%, 320px), 1fr)); }
.card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.7rem 1.6rem 1.9rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  transition: transform 0.35s cubic-bezier(0.2,0.7,0.2,1), border-color 0.35s ease, background 0.35s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 193, 94, 0.55);
  background: linear-gradient(180deg, rgba(255,193,94,0.12), rgba(255,138,107,0.05));
}
.card__label { display: block; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--oro); margin-bottom: 0.9rem; }
.card__body { margin: 0; color: #d5d0ee; font-size: 0.98rem; }

/* ------------------------------------------------------------------ Process */
.process { padding-top: clamp(9rem, 20vh, 15rem); } /* headline lands in daylight, below the sunrise crest */
.process .eyebrow { color: #7a2f4e; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(4, 1fr); counter-reset: none; }
.step { position: relative; padding-top: 1.4rem; border-top: 1px solid rgba(36, 21, 54, 0.28); }
.step__num { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em; color: #8a2f2f; }
.step__title { font-family: var(--serif); font-size: 1.9rem; margin: 0.4rem 0 0.7rem; }
.step__body { margin: 0; font-size: 0.98rem; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- Difference */
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(3, 1fr); }
.promise { border-top: 1px solid rgba(36, 21, 54, 0.28); padding-top: 1.4rem; }
.promise h3 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 0.6rem; }
.promise p { margin: 0; }
@media (max-width: 760px) { .promises { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Contact */
.contact { text-align: center; }
.contact__inner { max-width: 40rem; margin-inline: auto; }
.contact .eyebrow { color: #b8582f; }
.contact__title { font-size: clamp(2.6rem, 1.5rem + 5vw, 5.5rem); line-height: 1; margin-bottom: 1.2rem; }
.contact__body { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem); margin: 0 auto 2.2rem; max-width: 34ch; }
.contact__note { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--terra); margin-top: 2rem; }
.contact__note span[lang="it"] { color: #b8582f; }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600; font-size: 0.98rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn--sun {
  background: linear-gradient(115deg, var(--oro), var(--aurora));
  color: #2a1206;
  box-shadow: 0 10px 30px -8px rgba(255, 150, 90, 0.6);
}
.btn--sun:hover { box-shadow: 0 16px 40px -8px rgba(255, 160, 90, 0.75); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.28); color: var(--nebbia); }
.btn--ghost:hover { border-color: var(--oro); background: rgba(255, 193, 94, 0.08); }
.btn--ink {
  background: var(--inchiostro); color: var(--nebbia);
  font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; font-size: 1.05rem;
  padding: 1.1rem 2rem;
  box-shadow: 0 14px 36px -12px rgba(36, 21, 54, 0.55);
}
.btn--ink:hover { background: #35204d; box-shadow: 0 20px 44px -12px rgba(36, 21, 54, 0.65); }

/* ------------------------------------------------------------------- Footer */
.footer { padding-block: clamp(3rem, 6vw, 5rem); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.wordmark--footer { color: var(--inchiostro); font-size: 1.5rem; }
.wordmark--footer .wordmark__mark { box-shadow: 0 0 12px rgba(255, 160, 90, 0.5); }
.footer__brand p { margin: 0.7rem 0 0; color: var(--terra); font-size: 0.95rem; max-width: 30ch; }
.footer__meta { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; color: var(--terra); text-align: right; }
.footer__meta a { color: var(--inchiostro); font-weight: 500; }
.footer__meta a:hover { color: #b8582f; }
.footer__it { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: #b8582f; }
@media (max-width: 620px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__meta { text-align: left; }
}

/* ------------------------------------------------------- Motion & reveals */
/* Reveals only engage when JS confirms motion is allowed, so no-JS and
   reduced-motion visitors get the full page immediately. */
.js-anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js-anim .reveal.is-visible { opacity: 1; transform: none; }

.js-anim .hero__glow { animation: sunrise 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.js-anim .hero__stars { animation: fade-stars 3s ease both; }

@keyframes sunrise {
  from { transform: translateX(-50%) translateY(28vh) scale(0.82); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
@keyframes fade-stars { from { opacity: 0; } to { opacity: 0.8; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
