/* =============================================================
   be-digital.biz — Design System Stylesheet
   Task 1.1: Design tokens (:root)
   Requirements: 7.1, 7.2, 7.9
   ============================================================= */

/* ── 1. Design Tokens ──────────────────────────────────────── */
:root {
  /* ── Color palette ────────────────────────────────────────
     All hex values are declared here and ONLY here.
     Use var(--token) everywhere else in this file.       */
  --bg:        #0f172a;   /* slate-900  — primary dark background    */
  --surface:   #ffffff;   /* white      — card / light section bg    */
  --surface-2: #f8fafc;   /* slate-50   — alternate section bg       */
  --ink:       #0f172a;   /* primary text on light backgrounds       */
  --ink-2:     #475569;   /* secondary / subdued text                */
  --ink-inv:   #f8fafc;   /* text on dark backgrounds                */
  --accent:    #84cc16;   /* lime-500   — primary CTA, highlights    */
  --accent-2:  #22c55e;   /* green-500  — success states             */
  --line:      #e2e8f0;   /* slate-200  — borders, dividers          */

  /* ── Typography ───────────────────────────────────────────
     Inter loaded via @font-face from /assets/fonts/        */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif,
               "Inter";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --text-xs:   0.75rem;   /*  12px */
  --text-sm:   0.875rem;  /*  14px */
  --text-base: 1rem;      /*  16px */
  --text-lg:   1.125rem;  /*  18px */
  --text-xl:   1.25rem;   /*  20px */
  --text-2xl:  1.5rem;    /*  24px */
  --text-3xl:  2rem;      /*  32px */
  --text-4xl:  2.5rem;    /*  40px */
  --text-5xl:  3rem;      /*  48px */

  --weight-normal: 400;
  --weight-semi:   600;

  --leading-body:      1.6;
  --tracking-display: -0.02em;
  --measure:           70ch;   /* max line length for body text */

  /* ── Spacing (8px grid) ───────────────────────────────────
     Each step = 4px × multiplier (0.25rem base)           */
  --space-1:   0.25rem;  /*   4px */
  --space-2:   0.5rem;   /*   8px */
  --space-3:   0.75rem;  /*  12px */
  --space-4:   1rem;     /*  16px */
  --space-6:   1.5rem;   /*  24px */
  --space-8:   2rem;     /*  32px */
  --space-12:  3rem;     /*  48px */
  --space-16:  4rem;     /*  64px */
  --space-20:  5rem;     /*  80px */
  --space-24:  6rem;     /*  96px */

  /* ── Layout ───────────────────────────────────────────────*/
  --max-width: 1200px;
  --gutter:    var(--space-6);   /* 24px */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ── Status / feedback ────────────────────────────────────*/
  --error:     #dc2626;   /* red-600 — validation errors, form error states */

  /* ── Motion ───────────────────────────────────────────────*/
  --duration-fast:   150ms;
  --duration-normal: 200ms;
  --easing:          ease-in-out;
}

/* ── 2. Reduced-Motion ─────────────────────────────────────── */
/*
   Requirement 7.9: suppress all transform animations and
   transitions exceeding 200ms when the user has enabled
   prefers-reduced-motion.
*/
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1      !important;
    transition-duration:       0.01ms !important;
    scroll-behavior:           auto   !important;
  }
}

/* =============================================================
   Task 1.2: @font-face, base resets, and typography
   Requirements: 7.3
   ============================================================= */

/* ── 3. Font Loading ───────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ── 4. Box-Sizing Reset ───────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── 5. Base Typography ────────────────────────────────────── */
html {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink);
}

body {
  margin: 0;
}

/* ── 6. Readable Line Length ───────────────────────────────── */
p,
li,
blockquote {
  max-width: var(--measure);
}

/* ── 7. Image Reset ────────────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =============================================================
   Task 1.3: Layout utilities, responsive container, skip-link,
             base heading styles
   Requirements: 7.7, 7.8, 8.5
   ============================================================= */

/* ── 3. Container ──────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── 4. Mobile-first breakpoint scaffolding ────────────────── */
/*
   640px  — sm  (small tablets, large phones landscape)
   768px  — md  (tablets portrait)
   1024px — lg  (small desktops, tablets landscape)
   1280px — xl  (large desktops)

   Usage pattern:
     .element { /* mobile base * / }
     @media (min-width: 640px)  { .element { /* sm+ * / } }
     @media (min-width: 768px)  { .element { /* md+ * / } }
     @media (min-width: 1024px) { .element { /* lg+ * / } }
     @media (min-width: 1280px) { .element { /* xl+ * / } }
*/
@media (min-width: 640px)  { /* sm+ — small tablets */ }
@media (min-width: 768px)  { /* md+ — tablets portrait */ }
@media (min-width: 1024px) { /* lg+ — small desktops */ }
@media (min-width: 1280px) { /* xl+ — large desktops */ }

/* ── 5. Skip link (Requirement 8.5) ───────────────────────── */
/*
   Visually hidden by default; appears on :focus so keyboard
   users can bypass navigation and jump directly to #main.
*/
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;

  /* Visually hidden (screen-reader-accessible) */
  width:     1px;
  height:    1px;
  padding:   0;
  overflow:  hidden;
  clip:      rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border:    0;

  /* Base appearance — revealed on :focus below */
  background: var(--bg);
  color:      var(--ink-inv);
  font-weight: var(--weight-semi);
  font-size:   var(--text-sm);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.skip-link:focus {
  /* Restore visible dimensions */
  width:  auto;
  height: auto;
  clip:   auto;
  clip-path: none;
  white-space: normal;
  overflow: visible;

  /* Positioning so it sits just inside the viewport */
  top:    var(--space-2);
  left:   var(--space-2);
  padding: var(--space-2) var(--space-4);

  /* Accent outline satisfying WCAG 2.1 focus visibility */
  outline:        3px solid var(--accent);
  outline-offset: 2px;
}

/* ── 6. Base heading styles ────────────────────────────────── */
h1 {
  font-size:      var(--text-5xl);        /* 48px */
  font-weight:    var(--weight-semi);     /* 600  */
  letter-spacing: var(--tracking-display); /* -0.02em — display tracking on h1 only */
  line-height:    1.1;
}

h2 {
  font-size:   var(--text-3xl);       /* 32px */
  font-weight: var(--weight-semi);    /* 600  */
  line-height: 1.2;
}

h3 {
  font-size:   var(--text-2xl);       /* 24px */
  font-weight: var(--weight-semi);    /* 600  */
  line-height: 1.3;
}

/* =============================================================
   Task 1.4: Component CSS — Nav, Footer, Button, Card, Form
   Requirements: 7.4, 7.6, 8.1, 8.2, 9.5
   ============================================================= */

/* ══════════════════════════════════════════════════════════════
   NAV
   ══════════════════════════════════════════════════════════════ */

/* Inner flex row: logo left, nav links right */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

/* Header needs position: relative so the absolute mobile menu
   drops from the bottom of the header bar correctly */
header[role="banner"] {
  position: relative;
}

/* Dark-theme header sits over the slate-900 hero — give the bar a
   matching dark background so the light logo/links are legible and
   there is no white band above the hero. */
header[role="banner"][data-theme="dark"] {
  background: var(--bg);
}

/* Logo / wordmark */
.logo {
  display: inline-flex;
  align-items: center;
  font-weight: var(--weight-semi);
  font-size: var(--text-lg);
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}

/* Image logo — wordmark lockup; fixed height, aspect ratio preserved */
.logo-img {
  height: 40px;
  width: auto;
}

.logo:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Mobile hamburger — visible only below md (768px) */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Hide hamburger at md+ — nav links are always visible */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

/* Nav menu (#nav-menu is the <ul> itself) —
   mobile: hidden overlay panel, revealed with [data-open].
   List resets are applied directly to #nav-menu since the id
   lives on the <ul>, not a wrapping container. */
#nav-menu {
  list-style: none;
  margin: 0;
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  position: absolute;
  top: 100%;
  inset-inline: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: var(--space-4) var(--gutter);
}

#nav-menu[data-open] {
  display: flex;
}

/* Nav links */
#nav-menu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--ink);
  text-decoration: none;
  font-weight: var(--weight-semi);
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
}

#nav-menu a:hover {
  color: var(--accent);
}

#nav-menu a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

#nav-menu a[aria-current="page"] {
  color: var(--accent);
}

/* md+: nav always visible, horizontal layout */
@media (min-width: 768px) {
  #nav-menu {
    display: flex;
    flex-direction: row;
    gap: var(--space-1);
    position: static;
    background: none;
    border: none;
    padding: 0;
  }
}

/* Dark theme override — nav on dark-background pages */
[data-theme="dark"] .logo {
  color: var(--ink-inv);
}

[data-theme="dark"] .nav-toggle {
  color: var(--ink-inv);
}

[data-theme="dark"] #nav-menu {
  background: var(--bg);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #nav-menu a {
  color: var(--ink-inv);
}

[data-theme="dark"] #nav-menu a:hover {
  color: var(--accent);
}

[data-theme="dark"] #nav-menu a[aria-current="page"] {
  color: var(--accent);
}

@media (min-width: 768px) {
  [data-theme="dark"] #nav-menu {
    background: none;
    border: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-12);
  border-top: 1px solid var(--line);
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-name {
  font-weight: var(--weight-semi);
  font-size: var(--text-base);
  margin: 0;
  color: var(--ink);
}

.footer-inner address {
  font-style: normal;
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.footer-inner address a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-inner address a:hover {
  color: var(--accent);
}

.footer-inner address a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Footer nav list */
.footer-inner nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-inner nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--text-sm);
}

.footer-inner nav a:hover {
  color: var(--accent);
}

.footer-inner nav a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--ink-2);
  margin: 0;
  align-self: flex-end;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   Requirements: 7.6, 8.1, 8.2
   ══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);   /* 8px */
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semi);   /* 600 */
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--duration-normal) var(--easing);
  white-space: nowrap;
}

/* Focus ring — satisfies Req 8.2 visible focus on every interactive element */
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Hover brightness lift — both variants */
.btn:hover {
  filter: brightness(1.08);
}

/* Accent variant — lime bg, dark text; used on dark section backgrounds */
.btn--accent {
  background: var(--accent);
  color: var(--bg);
}

/* Accent-light variant — dark bg, light text; used on light section backgrounds */
.btn--accent-light {
  background: var(--bg);
  color: var(--ink-inv);
}

/* ══════════════════════════════════════════════════════════════
   CARDS
   Requirements: 7.6
   ══════════════════════════════════════════════════════════════ */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);   /* 12px */
  padding: var(--space-6);           /* 24px */
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--duration-normal) var(--easing),
              transform var(--duration-normal) var(--easing);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

/* Featured card — accent border + accent ring; used for mid-tier pricing */
.card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card--featured:hover {
  box-shadow: 0 0 0 2px var(--accent), 0 4px 16px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

/* Proof card — artifact / case-study links, no price element */
.card--proof {
  /* Same border/radius/padding as .card — no overrides needed beyond
     semantic distinction. The .card-price element is simply absent
     in the HTML when .card--proof is used. */
}

/* Card sub-elements */
.card-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.card-title {
  margin: 0;
}

.card-price {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semi);
  color: var(--ink);
  margin: 0;
}

.card-price span {
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--ink-2);
}

.card-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--ink-2);
  font-size: var(--text-sm);
  flex: 1;
}

.card-features li {
  max-width: none;           /* override the global p/li max-width inside cards */
  padding-inline-start: var(--space-4);
  position: relative;
}

.card-features li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--accent-2);
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   Requirements: 8.1, 8.2, 9.5
   ══════════════════════════════════════════════════════════════ */

/* Field wrapper */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Labels */
.field label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink);
}

/* Base styles for all input types — prevents iOS auto-zoom (min 16px),
   meets 44px minimum tap target (Req 9.5 / WCAG 2.5.5) */
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;                   /* hard 16px — never smaller, prevents iOS zoom */
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;                  /* tap target — Req 9.5 */
  transition: border-color var(--duration-fast) var(--easing),
              box-shadow var(--duration-fast) var(--easing);
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field input:invalid:not(:placeholder-shown),
.field select:invalid:not(:placeholder-shown),
.field textarea:invalid:not(:placeholder-shown) {
  border-color: var(--accent-2);
}

/* Textarea — allow vertical resize only */
.field textarea {
  resize: vertical;
  min-height: 120px;
}

/* Select — custom caret arrow */
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-inline-end: var(--space-8);
}

/* Field-level error message */
.field-error {
  font-size: var(--text-sm);
  color: var(--error);               /* red-600 — validation error */
  min-height: 1.25em;                /* reserves space to prevent layout shift */
  display: block;
}

/* Form status — success / error banner after submission */
.form-status {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  display: none;
}

.form-status:not(:empty) {
  display: block;
}

.form-status[data-status="success"] {
  background: color-mix(in srgb, var(--accent-2) 15%, var(--surface));
  color: var(--ink);
  border: 1px solid var(--accent-2);
}

.form-status[data-status="error"] {
  background: color-mix(in srgb, var(--error) 12%, var(--surface));
  color: var(--ink);
  border: 1px solid var(--error);
}

/* ══════════════════════════════════════════════════════════════
   PRICING GRID — three-column at lg+, stacked on mobile
   Used on /lane/web-presence/ pricing section
   ══════════════════════════════════════════════════════════════ */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

@media (min-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

/* Badge — "Most popular" label on the featured card */
.card-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  line-height: 1;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
}

/* ══════════════════════════════════════════════════════════════
   CONTACT PAGE — two-column layout
   Left: form; Right: direct contact details (added in 9.2)
   Requirements: 5.1, 5.8
   ══════════════════════════════════════════════════════════════ */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact-form-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.contact-form-col form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Right column — direct contact details */
.contact-details-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Each row: icon + text side by side */
.contact-detail-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-2);
}

.contact-detail-item svg {
  flex-shrink: 0;
  color: var(--accent);
}

.contact-detail-item a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-detail-item a:hover {
  color: var(--accent);
}

.contact-detail-item a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
