/* adfirm — styles
   Palette: warm paper, near-black ink, signal orange. Two type families. */

:root {
  --paper: #F5F2EA;
  --paper-2: #ECE8DC;
  --paper-3: #E2DDCE;
  --ink: #111318;
  --ink-2: #3B404B;
  --muted: #6E7380;
  --line: rgba(17, 19, 24, .12);
  --accent: #FF4E1F;
  --accent-deep: #E23F12;
  --dark: #111318;
  --dark-2: #191C23;
  --dark-line: rgba(245, 242, 234, .14);
  --dark-muted: #A9ADB7;
  --radius: 16px;
  --radius-lg: 24px;
  --container: 1180px;
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
address { font-style: normal; }
h1, h2, h3, h4 { margin: 0; }

.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 16px; }

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

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.brand-mark { height: 30px; width: auto; }
.brand-word { height: 26px; width: auto; }
.mark-cables { stroke: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font: 600 .95rem/1 var(--font-body);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 242, 234, .84);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { font-weight: 500; font-size: .95rem; color: var(--ink-2); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav .nav-cta { color: var(--paper); padding: 12px 18px; margin-left: 8px; }
.nav .nav-cta:hover { color: #fff; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 10px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; }
.site-header.open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.site-header.open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.75rem, 6.2vw, 5.4rem); line-height: .98; letter-spacing: -.035em;
  margin: 22px 0 26px; text-wrap: balance;
}
h1 .dim { color: var(--muted); }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--ink-2); max-width: 54ch; margin: 0 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-card {
  position: relative; overflow: hidden;
  background: var(--dark); color: var(--paper);
  border-radius: var(--radius-lg); aspect-ratio: 1 / 1.06;
  display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(rgba(245, 242, 234, .09) 1px, transparent 1px);
  background-size: 22px 22px;
}
.hero-card .mark { width: 56%; height: auto; }
.hero-card .cables { stroke: var(--accent); }
.hero-card .corner {
  position: absolute; font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--dark-muted);
}
.corner.tl { top: 20px; left: 22px; }
.corner.tr { top: 20px; right: 22px; }
.corner.bl { bottom: 20px; left: 22px; }
.corner.br { bottom: 20px; right: 22px; }

/* Draw-in animation for the hero mark */
.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) forwards; }
.draw .legs { animation-delay: .15s; }
.draw .deck { animation-delay: .55s; }
.draw .cables path { animation-duration: .8s; }
.draw .cables path:nth-child(1) { animation-delay: .95s; }
.draw .cables path:nth-child(2) { animation-delay: 1.05s; }
.draw .cables path:nth-child(3) { animation-delay: 1.15s; }
.draw .cables path:nth-child(4) { animation-delay: 1.25s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Strip ---------- */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.strip ul { display: flex; flex-wrap: wrap; gap: 10px 0; list-style: none; margin: 0; padding: 0; font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.strip li { display: flex; align-items: center; }
.strip li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: 0 18px; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 32px 48px; align-items: end; margin-bottom: 56px; }
h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.02; letter-spacing: -.03em;
  margin: 14px 0 0; text-wrap: balance;
}
.section-head p { margin: 0; color: var(--ink-2); font-size: 1.1rem; max-width: 50ch; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service {
  background: var(--paper-2); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 12px; min-height: 280px;
  transition: transform .35s var(--ease), background .35s;
}
.service:hover { transform: translateY(-4px); background: #fff; }
.service .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--paper); display: grid; place-items: center; margin-bottom: 6px; }
.service h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.service p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.tag { font-size: .74rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }

/* Approach (dark band) */
.approach { background: var(--dark); color: var(--paper); }
.approach .eyebrow { color: var(--dark-muted); }
.approach .section-head p { color: var(--dark-muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { border-top: 2px solid var(--dark-line); padding-top: 28px; transition: border-color .3s; }
.step:hover { border-top-color: var(--accent); }
.step .num { display: block; font-family: var(--font-display); font-size: 3rem; font-weight: 800; color: var(--accent); letter-spacing: -.04em; line-height: 1; }
.step h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin: 22px 0 10px; }
.step p { margin: 0; color: var(--dark-muted); font-size: .98rem; }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.case { display: flex; flex-direction: column; gap: 12px; }
.case .tile { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; margin-bottom: 8px; }
.tile-ink { background: var(--dark); }
.tile-accent { background: var(--accent); }
.tile-paper { background: var(--paper-3); }
.case .tile svg { width: 100%; height: 100%; transition: transform .6s var(--ease); }
.case:hover .tile svg { transform: scale(1.05); }
.case h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.case p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.case .tags { padding-top: 4px; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: start; }
.about h2 { margin-bottom: 26px; }
.about p { font-size: 1.12rem; color: var(--ink-2); }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.facts li span:first-child { color: var(--muted); flex: none; }
.facts li span:last-child { font-weight: 600; text-align: right; }

/* Contact */
.contact { background: var(--paper-2); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.contact-info h2 { margin-bottom: 18px; }
.contact-info > p { color: var(--ink-2); font-size: 1.1rem; }
.contact-info .mail {
  display: inline-block; margin: 8px 0 28px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.2;
  border-bottom: 2px solid var(--accent); transition: color .2s;
}
.contact-info .mail:hover { color: var(--accent); }
.contact-info address { color: var(--ink-2); line-height: 1.7; }

.form-card { background: #fff; border-radius: var(--radius-lg); padding: 32px; border: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; padding: 13px 16px; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%233B404B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 19, 24, .08); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: .85rem; color: var(--muted); margin: 16px 0 0; }
.form-note a { text-decoration: underline; text-underline-offset: 2px; }
.form-status { display: none; margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; font-size: .95rem; }
.form-status.show { display: block; }
.form-status.ok { background: #EAF5EC; color: #1F5A2E; }
.form-status.err { background: #FDECE6; color: #9A2E12; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--paper); padding: 72px 0 32px; }
.site-footer .brand { color: var(--paper); }
.footer-tag { color: var(--dark-muted); margin: 18px 0 0; max-width: 28ch; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--dark-line); }
.footer-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dark-muted); margin: 0 0 16px; font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .95rem; color: var(--dark-muted); }
.footer-grid li a { color: var(--paper); opacity: .85; transition: opacity .2s; }
.footer-grid li a:hover { opacity: 1; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: .85rem; color: var(--dark-muted); }
.footer-bottom a { color: var(--paper); opacity: .85; }
.footer-bottom a:hover { opacity: 1; }

/* ---------- Simple pages (privacy, 404) ---------- */
.page { padding: 64px 0 112px; }
.page .prose { max-width: 68ch; }
.page .prose h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 18px 0 28px; }
.page .prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.page .prose p, .page .prose li { color: var(--ink-2); }
.page .prose a { text-decoration: underline; text-underline-offset: 2px; }
.page .meta { color: var(--muted); font-size: .9rem; }
.notfound { min-height: 60vh; display: grid; align-content: center; }
.notfound .big { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 18vw, 12rem); line-height: .9; letter-spacing: -.05em; color: var(--paper-3); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in, .no-js .reveal { opacity: 1; transform: none; }
.services .reveal:nth-child(2), .steps .reveal:nth-child(2), .work-grid .reveal:nth-child(2) { transition-delay: .08s; }
.services .reveal:nth-child(3), .steps .reveal:nth-child(3), .work-grid .reveal:nth-child(3) { transition-delay: .16s; }
.services .reveal:nth-child(4), .steps .reveal:nth-child(4) { transition-delay: .24s; }
.services .reveal:nth-child(5) { transition-delay: .32s; }
.services .reveal:nth-child(6) { transition-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .draw path { animation: none; stroke-dashoffset: 0; }
  .btn, .service, .case .tile svg { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { gap: 40px; }
}
@media (max-width: 860px) {
  .container { width: min(var(--container), 100% - 40px); }
  /* The header's backdrop-filter makes it the containing block for fixed
     descendants, so the menu is sized explicitly below the 72px bar. */
  .nav {
    display: none; position: fixed; top: 72px; left: 0; right: 0; z-index: 40;
    height: calc(100vh - 72px); height: calc(100dvh - 72px);
    background: var(--paper); flex-direction: column; align-items: flex-start;
    padding: 32px 24px; gap: 22px; overflow-y: auto;
  }
  .site-header.open { background: var(--paper); border-bottom-color: var(--line); }
  .nav a { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; color: var(--ink); }
  .nav .nav-cta { font-family: var(--font-body); font-size: 1rem; margin: 12px 0 0; padding: 16px 24px; }
  .site-header.open .nav { display: flex; }
  .nav-toggle { display: flex; }
  .hero { padding: 48px 0 56px; }
  .hero-grid, .section-head, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 520px; }
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 40px; gap: 20px; }
  .about-grid { gap: 40px; }
  .contact-grid { gap: 40px; }
}
@media (max-width: 640px) {
  .container { width: min(var(--container), 100% - 32px); }
  .services, .steps, .work-grid, .footer-grid { grid-template-columns: 1fr; }
  .service { min-height: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-card { padding: 24px 20px; }
  .brand-word { height: 24px; }
  .brand-mark { height: 28px; }
  .footer-bottom { flex-direction: column; }
  .strip li + li::before { margin: 0 12px; }
}
