/* ── ECode Studio ── */

:root {
  --accent: #3B82F6;
  --accent-dark: #60A5FA;
  --accent-light: rgba(59,130,246,.1);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  --bg: #0B0F19;
  --bg-alt: #111827;
  --border: #1E293B;
  --border-light: #1E293B;
  --radius: 12px;
  --radius-lg: 20px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --container: 1100px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 {
  font-family: var(--serif); color: var(--text);
  line-height: 1.15; font-weight: 700; text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -.01em; }
h3 { font-size: 1.3rem; }
.accent { color: var(--accent-dark); font-style: italic; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; max-width: 600px; margin: 0 auto 56px; }
.section__lead { color: var(--text-muted); font-size: 1.1rem; margin-top: 12px; }

.eyebrow {
  display: inline-block; font-family: var(--sans);
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent-dark); margin-bottom: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 30px; border-radius: 50px;
  font-size: .9375rem; font-weight: 600;
  transition: all .2s ease; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #60A5FA; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(59,130,246,.35); }
.btn--outline { border: 1.5px solid var(--border); color: var(--text-muted); }
.btn--outline:hover { border-color: var(--text-muted); color: var(--text); }
.btn--sm { padding: 10px 22px; font-size: .8125rem; }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border-light);
}
.header__inner { display: flex; align-items: center; height: 64px; gap: 12px; }
.header__logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.02em; color: var(--text); flex-shrink: 0;
}
.header__logo-mark { flex-shrink: 0; }
.header__nav { display: flex; margin-left: auto; }
.header__menu { display: flex; align-items: center; gap: 2px; }
.header__link {
  padding: 8px 14px; border-radius: 8px;
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  transition: color .2s, background .2s;
}
.header__link:hover { color: var(--text); background: var(--bg-alt); }

.header__has-sub { position: relative; }
.header__sub-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 8px;
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  transition: color .2s, background .2s;
}
.header__sub-toggle:hover { color: var(--text); background: var(--bg-alt); }
.header__chevron { transition: transform .3s; }
.header__has-sub.is-open .header__chevron { transform: rotate(180deg); }
.header__sub {
  display: none; position: absolute; top: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  min-width: 200px; padding: 8px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.header__has-sub.is-open .header__sub { display: block; }
.header__sub a {
  display: block; padding: 10px 14px; border-radius: 8px;
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  transition: color .15s, background .15s;
}
.header__sub a:hover { color: var(--text); background: var(--bg-alt); }

.header__cta { margin-left: 12px; flex-shrink: 0; background: var(--accent); color: #fff; }
.header__cta:hover { background: var(--accent-dark); }
.header__burger { display: none; }

@media (max-width: 860px) {
  .header__nav, .header__cta { display: none; }
  .header__burger {
    display: flex; flex-direction: column; gap: 5px;
    width: 36px; height: 36px; align-items: center; justify-content: center;
    margin-left: auto;
  }
  .header__burger span {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: var(--text); transition: transform .3s, opacity .3s;
  }
  .header__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .header__burger.is-open span:nth-child(2) { opacity: 0; }
  .header__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  body.menu-open .header__nav {
    display: flex; flex-direction: column;
    position: fixed; inset: 64px 0 0; z-index: 99;
    background: var(--bg); padding: 24px var(--gutter); overflow-y: auto;
  }
  body.menu-open .header__cta {
    display: flex; justify-content: center;
    position: fixed; bottom: 24px; left: var(--gutter); right: var(--gutter);
    z-index: 100; margin: 0;
  }
  body.menu-open .header__menu { flex-direction: column; gap: 0; width: 100%; align-items: stretch; }
  body.menu-open .header__link,
  body.menu-open .header__sub-toggle {
    display: flex; width: 100%; padding: 16px 0;
    font-size: 1.25rem; font-weight: 600; color: var(--text);
    border-bottom: 1px solid var(--border-light); justify-content: center;
  }
  body.menu-open .header__sub {
    position: static; transform: none; border: none;
    box-shadow: none; padding: 0; min-width: 0; background: transparent;
  }
  body.menu-open .header__sub a {
    display: block; font-size: 1rem; padding: 14px 0; text-align: center;
    color: var(--text-muted); border-bottom: 1px solid var(--border-light); border-radius: 0;
  }
}

/* ── Hero ── */
.hero {
  padding: 80px 0 96px; min-height: 80svh;
  display: flex; align-items: center;
  background: radial-gradient(ellipse 80% 60% at 65% 40%, rgba(59,130,246,.06) 0%, transparent 70%);
}
.hero__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hero__copy { max-width: 520px; }
.hero__title { margin-bottom: 20px; }
.hero__lead { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 32px; max-width: 440px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-terminal {
  width: 100%; max-width: 460px;
  background: #1E293B; border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  overflow: hidden;
}
.hero-terminal__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; background: rgba(0,0,0,.25);
}
.hero-terminal__dot { width: 12px; height: 12px; border-radius: 50%; }
.hero-terminal__dot--red { background: #EF4444; }
.hero-terminal__dot--yellow { background: #F59E0B; }
.hero-terminal__dot--green { background: #22C55E; }
.hero-terminal__title { font-family: var(--mono); font-size: .7rem; color: rgba(255,255,255,.3); margin-left: auto; }
.hero-terminal__body {
  padding: 20px 22px 24px; font-family: var(--mono);
  font-size: .82rem; line-height: 1.9; color: #94A3B8;
}
.hero-terminal__prompt { color: #22C55E; }
.hero-terminal__cmd { color: #E2E8F0; }
.hero-terminal__comment { color: #64748B; }
.hero-terminal__accent { color: #60A5FA; }
.hero-terminal__success { color: #4ADE80; }
.hero-terminal__cursor {
  display: inline-block; width: 8px; height: 16px;
  background: rgba(255,255,255,.6); margin-left: 2px;
  animation: blink 1.2s step-end infinite; vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
  .hero { padding: 48px 0 64px; min-height: auto; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__visual { order: -1; }
  .hero__copy { max-width: none; }
  .hero__lead { max-width: none; }
}
@media (max-width: 480px) {
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

/* ── Service cards (grid) ── */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service-card {
  padding: 36px 28px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.service-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59,130,246,.15);
}
.service-card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.service-card h3 { margin-bottom: 8px; }
.service-card p { color: var(--text-muted); font-size: .92rem; line-height: 1.65; }
.service-card__link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: .85rem; font-weight: 600; color: var(--accent-dark);
}

@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

/* ── Process ── */
.process-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; text-align: center; }
.process-step__num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; margin: 0 auto 14px;
}
.process-step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.process-step p { color: var(--text-muted); font-size: .85rem; line-height: 1.55; }

@media (max-width: 860px) { .process-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .process-grid { grid-template-columns: 1fr 1fr; } }

/* ── CTA ── */
.cta-band { padding: 96px 0; }
.cta-box {
  padding: 64px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border: 1px solid var(--border); text-align: center;
}
.cta-box h2 { color: #F8FAFC; margin-bottom: 14px; }
.cta-box p { color: #94A3B8; max-width: 440px; margin: 0 auto 28px; font-size: 1.05rem; }
.cta-box .btn--primary { background: var(--accent); color: #fff; }
.cta-box .btn--primary:hover { background: #60A5FA; }
@media (max-width: 600px) { .cta-box { padding: 40px 24px; } }

/* ── Page hero (inner pages) ── */
.page-hero { padding: 72px 0 40px; text-align: center; }
.page-hero h1 { margin-bottom: 14px; }
.page-hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 540px; margin-inline: auto; }

/* ── Service detail (servizi page) ── */
.service-detail {
  padding: 40px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border); margin-bottom: 24px;
}
.service-detail__icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.service-detail h3 { margin-bottom: 10px; }
.service-detail p { color: var(--text-muted); margin-bottom: 14px; }
.service-detail ul { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.service-detail li { position: relative; padding-left: 24px; color: var(--text); }
.service-detail li::before {
  content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}
@media (max-width: 600px) { .service-detail { padding: 24px; } }

/* ── Projects ── */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project-card {
  padding: 36px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.project-card__placeholder {
  display: inline-block; padding: 5px 12px; border-radius: 50px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; background: rgba(251,191,36,.15); color: #FCD34D; margin-bottom: 14px;
}
.project-card h3 { margin-bottom: 8px; }
.project-card p { color: var(--text-muted); margin-bottom: 16px; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.project-card__tag {
  padding: 3px 10px; border-radius: 50px;
  font-size: .7rem; font-weight: 600; background: var(--accent-light); color: var(--accent-dark);
}
@media (max-width: 600px) { .projects-grid { grid-template-columns: 1fr; } }

/* ── About ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.about-card {
  padding: 36px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border);
}
.about-card__icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.about-card h3 { margin-bottom: 8px; }
.about-card p { color: var(--text-muted); line-height: 1.65; }
@media (max-width: 600px) { .about-grid { grid-template-columns: 1fr; } }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.contact-info h2 { margin-bottom: 14px; }
.contact-info p { color: var(--text-muted); margin-bottom: 24px; font-size: 1rem; }
.contact-item { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.contact-item__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-item a { color: var(--accent-dark); font-weight: 600; }
.contact-item a:hover { text-decoration: underline; }

.form-card {
  padding: 36px; border-radius: var(--radius-lg);
  background: var(--bg-alt); border: 1px solid var(--border);
}
.form-row { margin-bottom: 16px; }
.form-row label { display: flex; flex-direction: column; gap: 5px; }
.form-row label span { font-size: .8125rem; font-weight: 600; color: var(--text-muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius);
  background: var(--bg); border: 1.5px solid var(--border);
  font: inherit; font-size: .9375rem; color: var(--text);
  transition: border-color .2s; outline: none;
  color-scheme: dark;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-light); }
textarea.input { resize: vertical; min-height: 110px; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .875rem; color: var(--text-muted);
}
.checkbox-row input[type="checkbox"] { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.checkbox-row a { color: var(--accent-dark); text-decoration: underline; }
.form-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.form-note { text-align: center; color: var(--text-light); font-size: .8125rem; margin-top: 12px; }
.form-feedback {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px;
  font-size: .9rem; font-weight: 600;
}
.form-feedback--ok { background: rgba(34,197,94,.12); color: #4ADE80; border: 1px solid rgba(34,197,94,.25); }
.form-feedback--error { background: rgba(239,68,68,.12); color: #F87171; border: 1px solid rgba(239,68,68,.25); }

@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px; }
}

/* ── Legal ── */
.legal { padding-bottom: 80px; }
.legal__content { max-width: 680px; margin-inline: auto; }
.legal__content h2 { font-size: 1.4rem; margin: 36px 0 10px; }
.legal__content p { color: var(--text-muted); margin-bottom: 14px; }
.legal__content ul { margin-bottom: 14px; padding-left: 20px; }
.legal__content li { color: var(--text-muted); margin-bottom: 5px; list-style: disc; }
.legal__draft {
  display: inline-block; padding: 7px 16px; border-radius: 8px;
  background: rgba(251,191,36,.15); color: #FCD34D; font-size: .85rem; font-weight: 600; margin-bottom: 20px;
}

/* ── Footer ── */
.footer { background: #060911; color: rgba(255,255,255,.5); padding-top: 64px; border-top: 1px solid var(--border); }
.footer__inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 44px; }
.footer__brand .header__logo { color: #fff; margin-bottom: 10px; }
.footer__brand .header__logo-text { color: #fff; }
.footer__tagline { font-size: .85rem; color: rgba(255,255,255,.3); margin-top: 6px; }
.footer__heading {
  font-family: var(--sans); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.25); margin-bottom: 14px;
}
.footer__col ul { display: flex; flex-direction: column; gap: 8px; }
.footer__col a { color: rgba(255,255,255,.5); font-size: .85rem; transition: color .2s; }
.footer__col a:hover { color: #fff; }
.footer__col li { font-size: .85rem; }
.footer__cta {
  margin-top: 14px; background: var(--accent); color: #fff;
  border: 1px solid var(--accent); font-size: .8125rem;
}
.footer__cta:hover { background: #60A5FA; border-color: #60A5FA; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.06); padding: 18px 0; }
.footer__bottom-inner { display: flex; align-items: center; justify-content: space-between; }
.footer__bottom p { font-size: .8rem; color: rgba(255,255,255,.2); }
.footer__legal { display: flex; gap: 18px; }
.footer__legal a { font-size: .8rem; color: rgba(255,255,255,.2); transition: color .2s; }
.footer__legal a:hover { color: rgba(255,255,255,.5); }

@media (max-width: 860px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .footer__inner { grid-template-columns: 1fr; }
  .footer__bottom-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Reveal animation ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
