/* style.css — Loft Strategy Co design tokens + components */

/* ---------- Fonts ---------- */
:root {
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'General Sans', 'Segoe UI', sans-serif;
}

/* ---------- Type scale ---------- */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);
}

/* ---------- 4px spacing ---------- */
:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* ---------- Color — derived from the Loft Strategy Co mark ---------- */
:root,
[data-theme='light'] {
  /* Surfaces (warm cream, from the logo background) */
  --color-bg: #faf3e8;
  --color-surface: #fffcf6;
  --color-surface-2: #f5ecdd;
  --color-surface-offset: #f0e5d1;
  --color-surface-dynamic: #e9dcc3;
  --color-divider: #e6d9c2;
  --color-border: #ddccae;

  /* Text (deep navy-teal from the logo linework) */
  --color-text: #12333f;
  --color-text-muted: #5d6f72;
  --color-text-faint: #a2aeac;
  --color-text-inverse: #faf3e8;

  /* Primary accent — the mark's deep navy-teal */
  --color-primary: #0d3a4c;
  --color-primary-hover: #082630;
  --color-primary-active: #051920;
  --color-primary-highlight: #dbe4e3;

  /* Secondary accent — the collar's light teal */
  --color-accent: #6fa3ac;
  --color-accent-hover: #558790;
  --color-accent-highlight: #dde9e9;

  --color-warning: #964219;
  --color-warning-highlight: #ddcfc6;
  --color-error: #a12c7b;
  --color-error-highlight: #e0ced7;
  --color-success: #437a22;
  --color-success-highlight: #d4dfcc;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 220 / 0.07);
  --shadow-md: 0 6px 18px oklch(0.2 0.03 220 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.2 0.03 220 / 0.16);

  --content-narrow: 640px;
  --content-default: 1020px;
  --content-wide: 1220px;
  --content-full: 100%;

  /* Fixed brand colors — do NOT swap with theme. Used for branded panels
     (about visual, CTA block) that must always read as the mark's own
     navy/cream/teal regardless of light or dark mode. */
  --brand-ink: #0d3a4c;
  --brand-ink-deep: #082630;
  --brand-cream: #faf3e8;
  --brand-teal: #6fa3ac;
}

[data-theme='dark'] {
  --color-bg: #0b2530;
  --color-surface: #102e3a;
  --color-surface-2: #133440;
  --color-surface-offset: #163a47;
  --color-surface-dynamic: #1c4552;
  --color-divider: #1f4753;
  --color-border: #2b5763;

  --color-text: #f3ecdd;
  --color-text-muted: #b7c6c6;
  --color-text-faint: #6f8991;
  --color-text-inverse: #0b2530;

  --color-primary: #8fc4cc;
  --color-primary-hover: #a9d3da;
  --color-primary-active: #c1dfe4;
  --color-primary-highlight: #1c4a55;

  --color-accent: #7fb3bb;
  --color-accent-hover: #9bc4cb;
  --color-accent-highlight: #1c4a55;

  --color-warning: #d78d5f;
  --color-warning-highlight: #4a3628;
  --color-error: #d78bb8;
  --color-error-highlight: #402b3a;
  --color-success: #93c26e;
  --color-success-highlight: #2c3c22;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 18px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0b2530;
    --color-surface: #102e3a;
    --color-surface-2: #133440;
    --color-surface-offset: #163a47;
    --color-surface-dynamic: #1c4552;
    --color-divider: #1f4753;
    --color-border: #2b5763;
    --color-text: #f3ecdd;
    --color-text-muted: #b7c6c6;
    --color-text-faint: #6f8991;
    --color-text-inverse: #0b2530;
    --color-primary: #8fc4cc;
    --color-primary-hover: #a9d3da;
    --color-primary-active: #c1dfe4;
    --color-primary-highlight: #1c4a55;
    --color-accent: #7fb3bb;
    --color-accent-hover: #9bc4cb;
    --color-accent-highlight: #1c4a55;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 6px 18px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
  }
}

/* ================= Layout helpers ================= */
.wrap {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-32));
}

/* About, Services, and Approach sit back-to-back on the same background —
   tighten their rhythm so the seams don't read as empty space. */
#about,
#services,
#approach {
  padding-block: clamp(2.5rem, 4vw, 3.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-hover);
}
[data-theme='dark'] .eyebrow {
  color: var(--color-accent);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1.5px;
  background: currentColor;
  display: inline-block;
}

h2.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-top: var(--space-3);
}

.section-lede {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-top: var(--space-4);
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--space-12);
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}
.section-head.center .eyebrow::before {
  display: none;
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-surface-offset);
  border-color: var(--color-text-faint);
}

.btn-sm {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-xs);
}

/* ================= Header ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.header--hidden {
  transform: translateY(-100%);
}
.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.brand img {
  height: 40px;
  width: auto;
}
.brand-word {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1;
}
.brand-word span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav-links a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--color-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text-faint);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

/* ================= Hero ================= */
.hero {
  padding-block: clamp(var(--space-20), 10vw, var(--space-32)) clamp(var(--space-16), 8vw, var(--space-24));
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-16);
  align-items: center;
}

.hero-copy .eyebrow {
  margin-bottom: var(--space-6);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-3xl);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.hero-title em {
  font-style: italic;
  color: var(--color-primary);
}
[data-theme='dark'] .hero-title em {
  color: var(--color-accent);
}

.hero-sub {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}

.hero-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-10);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: 380px;
}
.hero-visual-card img {
  width: 78%;
}

.hero-visual-tag {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ================= Stat bar ================= */
.stats {
  padding-block: var(--space-12);
  border-block: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}
.stat {
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--color-primary);
}
[data-theme='dark'] .stat-num {
  color: var(--color-accent);
}
.stat-label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

/* ================= About ================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-inline: auto;
}

/* ================= Showcase (full-bleed editorial image) ================= */
.showcase {
  position: relative;
  padding-block: 0;
  min-height: clamp(320px, 52vw, 560px);
  overflow: hidden;
}
.showcase-media {
  position: absolute;
  inset: 0;
}
.showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  display: block;
}

.about-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-visual img {
  width: 60%;
  filter: drop-shadow(0 12px 24px oklch(0 0 0 / 0.25));
}

.about-copy p + p {
  margin-top: var(--space-5);
}
.about-copy p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.about-list {
  margin-top: var(--space-8);
  display: grid;
  gap: var(--space-4);
}
.about-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.about-list li svg {
  flex-shrink: 0;
  color: var(--color-accent-hover);
  margin-top: 3px;
}
[data-theme='dark'] .about-list li svg {
  color: var(--color-accent);
}

/* ================= Services ================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme='dark'] .service-icon {
  color: var(--color-accent);
}

.service-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.service-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.service-num {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.1em;
}

/* ================= Approach ================= */
.approach-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}
.approach-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/5;
}
.approach-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.approach-list {
  display: grid;
  gap: 0;
  margin-top: var(--space-4);
}
.approach-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}
.approach-item:last-child {
  border-bottom: 1px solid var(--color-divider);
}
.approach-index {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-accent-hover);
}
[data-theme='dark'] .approach-index {
  color: var(--color-accent);
}
.approach-body h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.approach-body p {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 60ch;
}

/* ================= CTA / Contact ================= */
.cta-section {
  background: var(--brand-ink);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-10), 6vw, var(--space-16));
  color: var(--brand-cream);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-12);
  align-items: start;
}
.cta-intro .eyebrow {
  color: var(--brand-teal);
}
.cta-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  margin-top: var(--space-3);
  color: var(--brand-cream);
}
.cta-section p {
  margin-top: var(--space-4);
  color: oklch(from var(--brand-cream) l c h / 0.8);
  max-width: 50ch;
}
.cta-email {
  display: inline-block;
  margin-top: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--brand-cream);
  text-decoration: none;
  border-bottom: 1px solid oklch(from var(--brand-cream) l c h / 0.35);
  padding-bottom: 4px;
}
.cta-email:hover {
  border-color: var(--brand-cream);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.form-row-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-row label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(from var(--brand-cream) l c h / 0.65);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--brand-ink);
  background: var(--brand-cream);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.contact-form textarea {
  resize: vertical;
  min-height: 96px;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--color-text-faint);
}
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: none;
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px oklch(from var(--brand-teal) l c h / 0.35);
}
.contact-form input:invalid.touched,
.contact-form textarea:invalid.touched {
  border-color: #d98c8c;
}
.form-submit {
  background: var(--brand-cream);
  color: var(--brand-ink);
  align-self: flex-start;
}
.form-submit:hover:not(:disabled) {
  background: color-mix(in oklab, var(--brand-cream), white 20%);
}
.form-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}
.form-status {
  font-size: var(--text-sm);
  min-height: 1.2em;
}
.form-status[data-state='success'] {
  color: #a8d8b9;
}
.form-status[data-state='error'] {
  color: #e6a3a3;
}

/* ================= Footer ================= */
.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer-brand img {
  height: 30px;
  width: auto;
}
.footer-brand-word {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.footer-links {
  display: flex;
  gap: var(--space-6);
}
.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--color-text);
}
.footer-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-faith {
  display: flex;
  justify-content: center;
  margin-top: var(--space-6);
  color: var(--color-text-faint);
  opacity: 0.55;
}

/* ================= Reveal animation ================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Responsive ================= */
@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .approach-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
  }
  .hero-visual-card {
    max-width: 280px;
    margin-inline: auto;
  }
  .approach-visual {
    order: -1;
    max-width: 420px;
    margin-inline: auto;
    width: 100%;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  .cta-section {
    grid-template-columns: 1fr;
  }
  .form-row-group {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .approach-item {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand-word span {
    display: none;
  }
  .brand img {
    height: 32px;
  }
  .header-inner {
    padding-block: var(--space-3);
  }
  .header-actions .btn {
    display: none;
  }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-nav.is-open {
  transform: translateX(0);
}
.mobile-nav-top {
  display: flex;
  justify-content: flex-end;
}
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-12);
}
.mobile-nav-links a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
}
.mobile-nav-cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}
