/* ==========================================================================
   Adelfa Digital - shared stylesheet
   Palette drawn from brand logo: sage green + deep navy on warm light base
   ========================================================================== */

:root {
  --sage: #7ca47d;
  --sage-dark: #5f8a60;
  --sage-soft: #e8efe6;
  --sage-mist: #f3f7f1;
  --navy: #1e3a5c;
  --navy-deep: #162c47;
  --ink: #2a3441;
  --ink-soft: #55606e;
  --cream: #fbfaf7;
  --white: #ffffff;
  --line: #e5e5df;

  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(30, 58, 92, 0.07);
  --shadow-md: 0 8px 28px rgba(30, 58, 92, 0.1);
  --shadow-lg: 0 18px 48px rgba(30, 58, 92, 0.14);

  --wrap: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sage-dark); text-decoration: none; }
a:hover { color: var(--navy); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.15;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: 0.9rem;
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 42em;
}

.section-head { max-width: 46em; margin-bottom: 3rem; }
.section-head p { color: var(--ink-soft); margin-top: 0.9rem; }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: var(--wrap);
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand img { height: 44px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 0.3rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--sage);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--navy); }

.nav-cta {
  background: var(--navy);
  color: var(--white) !important;
  padding: 0.55rem 1.25rem !important;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--sage-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--sage-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-ghost:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-light {
  background: var(--white);
  color: var(--navy);
}
.btn-light:hover { background: var(--sage-soft); color: var(--navy); transform: translateY(-2px); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.hero::before {
  content: "";
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(46vw, 560px);
  aspect-ratio: 489 / 653;
  background: url("../assets/logo-mark.png") no-repeat center / contain;
  opacity: 0.07;
  pointer-events: none;
}

.hero .wrap { position: relative; }
.hero h1 { max-width: 15em; }
.hero .lede { margin: 1.4rem 0 2.4rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-sage { background: var(--sage-mist); }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--sage);
}

.card h3 { margin-bottom: 0.6rem; }
.card p { color: var(--ink-soft); font-size: 0.98rem; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--sage-soft);
  display: grid;
  place-items: center;
  margin-bottom: 1.3rem;
  color: var(--sage-dark);
}
.card-icon svg { width: 26px; height: 26px; }

.card .tag-row { margin-top: auto; padding-top: 1.2rem; }

.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--sage-mist);
  border: 1px solid var(--sage-soft);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin: 0 0.35rem 0.35rem 0;
}

/* ---------- Stats ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--sage-dark);
  line-height: 1.1;
}

.stat span {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Steps (How we work) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  position: relative;
  counter-increment: step;
}

.step::before {
  content: "0" counter(step);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
  background: var(--sage);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
}

.step h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.step p { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  left: -4%;
  bottom: -30%;
  width: 280px;
  aspect-ratio: 489 / 653;
  background: url("../assets/logo-mark.png") no-repeat center / contain;
  opacity: 0.08;
  filter: brightness(4);
  pointer-events: none;
}

.cta-band h2 { color: var(--white); margin-bottom: 0.8rem; }
.cta-band p { color: rgba(255, 255, 255, 0.75); max-width: 38em; margin: 0 auto 2rem; }

/* ---------- Two-column layout ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

.split .visual {
  background: var(--sage-mist);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: grid;
  place-items: center;
}

/* ---------- Portfolio / case studies ---------- */

.project {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.project-banner {
  height: 150px;
  display: grid;
  place-items: center;
  color: var(--white);
}
.project-banner svg { width: 56px; height: 56px; opacity: 0.95; }

.banner-sage { background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%); }
.banner-navy { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); }

.project-body { padding: 1.8rem; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { margin-bottom: 0.6rem; }
.project-body p { color: var(--ink-soft); font-size: 0.97rem; }
.project-body .tag-row { margin-top: auto; padding-top: 1.2rem; }

/* ---------- Forms ---------- */

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 2.8rem);
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(124, 164, 125, 0.2);
}

.field textarea { resize: vertical; min-height: 140px; }

.form-note { font-size: 0.88rem; color: var(--ink-soft); margin-top: 1rem; }

.alert {
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.alert-error { background: #fdecec; color: #8c2f2f; border: 1px solid #f3c9c9; }
.alert-success { background: var(--sage-soft); color: var(--sage-dark); border: 1px solid var(--sage); }

/* Honeypot: hidden from humans */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.72);
  padding: 3.5rem 0 2rem;
  margin-top: clamp(3rem, 8vw, 5rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.footer-brand img { height: 40px; }
.footer-brand .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--white);
}
.footer-brand .brand-name span { color: var(--sage); }

.site-footer h4 {
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: rgba(255, 255, 255, 0.72); }
.site-footer a:hover { color: var(--sage); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Legal pages ---------- */

.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.toc {
  position: sticky;
  top: 90px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
}

.toc-list {
  list-style: none;
  counter-reset: none;
  font-size: 0.88rem;
}

.toc-list li { margin-bottom: 0.45rem; line-height: 1.35; }
.toc-list a { color: var(--ink-soft); }
.toc-list a:hover { color: var(--sage-dark); }

.legal-note {
  background: var(--sage-mist);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.legal-content { min-width: 0; }
.legal-content h2 {
  font-size: 1.35rem;
  margin: 2.4rem 0 0.9rem;
  padding-top: 0.5rem;
  scroll-margin-top: 90px;
}
.legal-content h3 {
  font-size: 1.05rem;
  margin: 1.6rem 0 0.6rem;
}
.legal-content p {
  margin-bottom: 0.9rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.legal-content ul {
  margin: 0 0 1rem 1.4rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.legal-content li { margin-bottom: 0.4rem; }

.table-scroll { overflow-x: auto; margin: 1.2rem 0; }
.legal-content table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.92rem;
}
.legal-content th, .legal-content td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
  color: var(--ink-soft);
}
.legal-content th {
  background: var(--sage-mist);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover, .project:hover, .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links.open { max-height: 420px; }

  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    width: 100%;
  }
  .nav-links a::after { display: none; }
  .nav-cta { margin: 0.5rem 1.5rem 1rem; display: inline-block; width: auto !important; border-radius: 999px; }

  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero::before { opacity: 0.045; }
}
