/* =========================================================
   Andrea Gaglione — gaglioneandrea.com
   Design system: pure B/W. No accent color.
   Font: system-only (SF Pro on Apple, Segoe UI on Windows,
         Roboto on Android), no Google Fonts.
   ========================================================= */

/* -------- Tokens -------- */
:root {
  --black: #0a0a0a;
  --black-soft: #1a1a1a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f3f3f3;
  --gray-200: #e7e7e7;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;

  --max-w: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-py: clamp(4.5rem, 9vw, 7.5rem);

  --radius: 4px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* System font stack: SF Pro on Apple, Segoe UI on Windows, Roboto on Android */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
               'Segoe UI', 'Segoe UI Variable', Roboto, 'Helvetica Neue', Arial,
               'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 160ms;
  --t-med: 280ms;
}

/* -------- Reset / Base -------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--black);
}

@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;
  }
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* page-wide entrance fade: header + hero + everything else fade together */
  animation: pageFade 1100ms ease both;
}
@keyframes pageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

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

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

ul, ol { padding: 0; list-style: none; }

::selection { background: var(--black); color: var(--white); }

/* -------- Accessibility -------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--black);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 9999;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
  border-radius: 2px;
}

/* honeypot */
.hp-field {
  position: absolute !important;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -------- Layout -------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* -------- Typography (system-font hierarchy) -------- */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--black);
}

h1 { font-size: clamp(2.5rem, 6.4vw, 4.75rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.875rem, 4.4vw, 3rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.2rem, 1.9vw, 1.45rem); font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 600; letter-spacing: -0.015em; }

p { color: var(--gray-700); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}

/* -------- Text-effect utilities (use inside i18n HTML strings) -------- */
.t-underline {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 1.5px;
  text-decoration-skip-ink: none;
}
.t-italic { font-style: italic; }
.t-bold { font-weight: 800; }
.t-strike { text-decoration: line-through; }
.t-highlight {
  background: var(--black);
  color: var(--white);
  padding: 0 0.1em;
  margin: 0 -0.02em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* invert variant for use on dark sections */
.t-highlight-light {
  background: var(--white);
  color: var(--black);
  padding: 0 0.1em;
  margin: 0 -0.02em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* hero accent stays italic + lighter tone */
.accent {
  font-style: italic;
  font-weight: 500;
  color: var(--gray-400);
}

/* italics inside dark hero text get a lighter color */
.hero em, .hero .t-italic { color: rgba(255, 255, 255, 0.92); }
.hero strong, .hero .t-bold { color: var(--white); font-weight: 700; }
.hero .t-underline {
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* on dark sections (hero, header): white pill, hover invert */
.btn-primary {
  background: var(--white);
  color: var(--black);
}
.btn-primary:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

/* on light sections: dark pill, hover invert */
.performance .btn-primary,
.services .btn-primary,
.process .btn-primary,
.tools .btn-primary,
.about .btn-primary,
.contact .btn-primary {
  background: var(--black);
  color: var(--white);
}
.performance .btn-primary:hover,
.services .btn-primary:hover,
.process .btn-primary:hover,
.tools .btn-primary:hover,
.about .btn-primary:hover,
.contact .btn-primary:hover {
  background: transparent;
  color: var(--black);
  border-color: var(--black);
}

.btn-ghost {
  background: transparent;
  color: var(--black);
  border-color: var(--gray-300);
}
.btn-ghost:hover { background: var(--black); color: var(--white); border-color: var(--black); }

.btn-sm { padding: 0.65rem 1.1rem; font-size: 0.88rem; }
.btn-full { width: 100%; }

/* Attention-grabbing variant: slow opacity blink + arrow nudge */
.btn-attract {
  animation: btnBlink 5s ease-in-out infinite;
}
.btn-attract:hover {
  animation-play-state: paused;
  opacity: 1;
}
@keyframes btnBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.btn-arrow {
  display: inline-block;
  font-weight: 400;
  transition: transform var(--t-fast) var(--ease);
}
.btn:hover .btn-arrow { transform: translateX(4px); }

/* Reduce-motion: keep two intentional, gentle animations running
   anyway — page fade (one-shot, no movement) and the attention blink
   (opacity-only, no movement). Continuous motion-based effects are
   still disabled by the global override. */
@media (prefers-reduced-motion: reduce) {
  body         { animation: pageFade 1100ms ease both !important; }
  .btn-attract { animation: btnBlink 2.8s ease-in-out infinite !important; }
}

/* -------- Header (static, black bg) -------- */
.site-header {
  position: relative;
  z-index: 50;
  background: var(--black);
  color: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-mark {
  height: 26px;
  width: auto;
  filter: invert(1);
  transition: opacity var(--t-fast) var(--ease);
}
.brand:hover .brand-mark { opacity: 0.7; }

.nav-desktop {
  display: none;
  gap: 1.75rem;
  flex: 1;
  justify-content: center;
}
.nav-desktop a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  padding: 0.25rem 0;
  transition: color var(--t-fast) var(--ease);
}
.nav-desktop a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width var(--t-med) var(--ease);
}
.nav-desktop a:hover { color: var(--white); }
.nav-desktop a:hover::after { width: 100%; }

@media (min-width: 880px) {
  .nav-desktop { display: inline-flex; }
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.6);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lang-switch:hover { border-color: var(--white); color: var(--white); }
.lang-switch .lang-current { color: var(--white); }
.lang-switch .lang-divider { color: rgba(255, 255, 255, 0.25); font-weight: 400; }

.header-cta { display: none; }
@media (min-width: 600px) {
  .header-cta { display: inline-flex; }
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 18px;
  padding: 0;
  color: var(--white);
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (min-width: 880px) {
  .nav-toggle { display: none; }
}

.nav-mobile {
  display: flex;
  flex-direction: column;
  padding: 1rem var(--gutter) 1.5rem;
  background: var(--black);
  gap: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-mobile a {
  display: block;
  padding: 0.85rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile[hidden] { display: none; }

/* -------- Hero (dark) -------- */
.hero {
  background: var(--black);
  color: var(--white);
  padding-block: clamp(3rem, 6vw, 5rem) var(--section-py);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  grid-template-columns: 1fr;
  position: relative;
}
@media (min-width: 880px) {
  .hero-inner {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
}

.hero-content { max-width: 720px; }

.hero-title {
  margin: 0 0 1.75rem;
  color: var(--white);
}
/* only the top-level title spans (titleA, titleB) are block,
   so nested spans like .t-underline stay inline */
.hero-title > span { display: block; }

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}
.hero-sub + .hero-sub { margin-top: 1.25rem; }
.hero-sub:last-of-type { margin-bottom: 2.5rem; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
@media (max-width: 879px) {
  .hero-cta { justify-content: center; }
}

.hero-photo {
  position: relative;
  justify-self: center;
  width: clamp(130px, 17vw, 190px);
  aspect-ratio: 1;
}
.hero-photo::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-photo picture, .hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}
.hero-photo img {
  object-fit: cover;
  object-position: center;
  filter: grayscale(100%) contrast(1.05) brightness(0.97);
}

/* -------- Section heads -------- */
.section-head {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head h2 {
  margin-bottom: 0;
}
.section-lead {
  margin-top: 1.25rem;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--gray-600);
}

/* -------- Performance (featured top section) -------- */
.performance {
  padding-block: var(--section-py);
  background: var(--white);
}

.platform-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .platform-grid { grid-template-columns: 1fr 1fr; }
}

.platform-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
}
.platform-logo {
  height: clamp(34px, 3.5vw, 44px);
  width: auto;
  filter: brightness(0);
  margin-bottom: 1.5rem;
}
.platform-logo[alt^="Meta"] {
  height: clamp(26px, 2.6vw, 34px);
}
.platform-card > p {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.platform-steps {
  display: grid;
  gap: 0.85rem;
  counter-reset: step;
  padding-left: 0;
  list-style: none;
}
.platform-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--gray-700);
}
.platform-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.04em;
}

/* -------- Services -------- */
.services {
  padding-block: var(--section-py);
  background: var(--white);
  border-top: 1px solid var(--gray-100);
}

.service-grid {
  display: grid;
  gap: clamp(2.5rem, 4vw, 3.5rem) clamp(2rem, 4vw, 4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .service-grid { grid-template-columns: repeat(3, 1fr); }
}

.service-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.service-card h3 {
  margin-bottom: 1rem;
  color: var(--black);
}
.service-card > p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.65;
  color: var(--gray-600);
}

.service-list {
  margin-top: auto;
  padding-top: 1rem;
}
.service-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 1.1rem;
  color: var(--gray-700);
  padding: 0.4rem 0;
}
.service-list li::before {
  content: '';
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--black);
  margin-top: 0.6rem;
}

/* -------- Process -------- */
.process {
  padding-block: var(--section-py);
  background: var(--gray-50);
}

.process-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--gray-200);
}
.process-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--gray-200);
  transition: padding-left var(--t-med) var(--ease);
}
@media (min-width: 720px) {
  .process-item {
    grid-template-columns: 100px 1fr;
    gap: 2.5rem;
    align-items: baseline;
  }
}
.process-item:hover { padding-left: 0.5rem; }
.process-num {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--gray-400);
  line-height: 1;
  letter-spacing: -0.03em;
}
.process-body h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.process-body p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gray-600);
}

/* -------- Tools (static borderless grid) -------- */
.tools {
  padding-block: var(--section-py);
  background: var(--white);
}
.tools-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.tools-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  justify-items: center;
  background: transparent;
  border: none;
  padding: clamp(1.5rem, 3vw, 2rem) 0;
}
.tools-grid li {
  display: grid;
  place-items: center;
  height: 52px;
  width: 100%;
  padding: 0 14px;
  box-sizing: border-box;
  cursor: default;
}
.tools-grid img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.55;
  transition: opacity var(--t-fast) var(--ease);
}
.tools-grid li:hover img { opacity: 1; }

/* -------- About -------- */
.about {
  padding-block: var(--section-py);
  background: var(--white);
  border-top: 1px solid var(--gray-100);
}

.about-inner {
  /* fills container */
}

.about-text h2 {
  margin-bottom: 1.75rem;
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gray-700);
}
.about-text p + p { margin-top: 1.25rem; }

/* -------- Contact -------- */
.contact {
  padding-block: var(--section-py);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
}

.contact-inner {
  max-width: 720px;
}

.contact-inner h2 { margin-bottom: 1.25rem; }
.contact-lead {
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
  line-height: 1.65;
}

.contact-channels {
  display: grid;
  gap: 0.75rem;
}
.contact-channels a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  min-width: 0;
}
.contact-channels a:hover {
  border-color: var(--black);
  transform: translateX(3px);
}
.channel-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--gray-100);
  color: var(--black);
  border-radius: 50%;
  font-size: 1.05rem;
}
.channel-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-500);
}
.channel-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--black);
  overflow-wrap: anywhere;
  min-width: 0;
}

.contact-form {
  display: grid;
  gap: 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.form-row { display: grid; gap: 0.4rem; }
.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gray-700);
}
.form-row label .optional {
  font-weight: 400;
  color: var(--gray-500);
  text-transform: none;
  letter-spacing: 0;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--black);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
.form-row textarea { resize: vertical; min-height: 110px; }

.form-status {
  min-height: 1.4em;
  font-size: 0.92rem;
  margin-top: 0.25rem;
  text-align: center;
}
.form-status[data-state="success"] { color: var(--black); font-weight: 600; }
.form-status[data-state="error"] { color: var(--black); font-weight: 600; }
.form-status[data-state="sending"] { color: var(--gray-500); }

/* -------- Footer -------- */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding-block: 2.5rem;
  font-size: 0.9rem;
}
.footer-inner { text-align: center; }

/* -------- Reveal animation -------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}
