/* ============================================
   Gallogly Strategies — Shared Styles
   ============================================ */

/* ---------- Self-hosted fonts ---------- */
/* Latin-subset files from Google Fonts, served locally instead of from
   fonts.googleapis.com/fonts.gstatic.com (no third-party font request). */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-variable-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-variable-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-variable-latin.woff2") format("woff2");
}

:root {
  /* Light mode (default) */
  --bg: #FAF7F1;
  --surface: #F1ECE1;
  --border: #E1D9C9;
  --text-primary: #17152A;
  --text-secondary: #4A4756;
  --text-caption: #6F6C76;
  --accent-fill: #D98E4A;
  --accent-text: #A55825;
  --accent-rgb: 217, 142, 74;
  --on-accent: #17152A;
  --error-text: #B3261E;

  --font-serif: "Instrument Serif", serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-sans: "Inter", sans-serif;

  --radius: 3px;
  --max-width: 1120px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0C0A1D;
  --surface: #14122A;
  --border: #2A2840;
  --text-primary: #F3F1EA;
  --text-secondary: #D8D8D0;
  --text-caption: #8A8A94;
  --accent-text: #D98E4A;
  --error-text: #E5675A;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    /* No-JS fallback: the inline bootstrap script normally sets data-theme
       explicitly (to the stored choice, or the OS preference otherwise), so
       this rule only fires with JS disabled. */
    --bg: #0C0A1D;
    --surface: #14122A;
    --border: #2A2840;
    --text-primary: #F3F1EA;
    --text-secondary: #D8D8D0;
    --text-caption: #8A8A94;
    --accent-text: #D98E4A;
    --error-text: #E5675A;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* Deliberate standard utility, kept on hand for screen-reader-only text even
   though nothing currently uses it (the site's one visually-hidden need,
   .skip-link, is served by its own component). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 1000;
  background: var(--accent-fill);
  color: var(--on-accent);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.92rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

@media (max-width: 820px) {
  .container {
    padding: 0 20px;
  }
}

/* ---------- Eyebrow / mono labels ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-fill);
  flex-shrink: 0;
}

/* ---------- Headings ---------- */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  max-width: 16ch;
}

h2 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0;
}

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

.cta-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cta-group .btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-text);
}

/* .btn-primary's own fill is the accent color, so the ring above is
   invisible against it (identical value in dark mode) or sub-threshold
   (light mode). --on-accent gives it real separation in both themes. */
.cta-group .btn-primary:focus-visible {
  box-shadow: inset 0 0 0 2px var(--on-accent);
}

.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 13px 26px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-left: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-solo {
  display: inline-block;
  border-radius: var(--radius);
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 24px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 2rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--accent-text);
}

.nav-links a.active {
  color: var(--text-primary);
}

/* Mirrors the desktop CTA into the mobile dropdown only; hidden everywhere
   else (see .site-nav.menu-open .nav-links .nav-cta-item below). */
.nav-links .nav-cta-item {
  display: none;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Theme toggle — pill switch */

.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  cursor: pointer;
  width: 60px;
  height: 32px;
  flex-shrink: 0;
}

.theme-toggle .toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-fill);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

:root[data-theme="dark"] .theme-toggle .toggle-knob {
  transform: translateX(28px);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  color: var(--on-accent);
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 4px;
}

.nav-toggle-btn svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 860px) {
  .nav-links,
  .nav-cta .cta-group {
    display: none;
  }

  .nav-right {
    gap: 16px;
  }

  .nav-toggle-btn {
    display: flex;
  }

  .site-nav.menu-open .nav-links {
    display: flex;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.28), 0 4px 10px -4px rgba(0, 0, 0, 0.18);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 20px;
  }

  .site-nav.menu-open .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .site-nav.menu-open .nav-links li:last-child {
    border-bottom: none;
  }

  .site-nav.menu-open .nav-links a {
    display: block;
    padding: 14px 0;
  }

  .site-nav.menu-open .nav-links li.nav-cta-item {
    border-bottom: none;
    padding-top: 12px;
  }

  .site-nav.menu-open .nav-links .nav-cta-item {
    display: block;
  }

  .site-nav.menu-open .nav-links li.nav-cta-item a.btn.btn-primary {
    display: block;
    padding: 13px 26px;
    color: var(--on-accent);
    text-align: center;
    border-radius: var(--radius);
  }

  .site-nav.menu-open .nav-cta .cta-group {
    display: none;
  }
}

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

.hero {
  padding: 96px 0 100px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.hero h1 {
  margin-top: 6px;
  font-size: clamp(2.5rem, 4.55vw, 3.75rem);
  max-width: 18ch;
}

.hero p.lede {
  color: var(--text-secondary);
  font-size: 1.3rem;
  max-width: 64ch;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .hero {
    padding: 56px 0 64px;
  }
}

/* ---------- Section spacing ---------- */

section {
  padding: 88px 0;
}

section.tight {
  padding: 64px 0;
}

.section-header {
  margin-bottom: 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-header h2 {
  margin-top: 4px;
}

.border-top {
  border-top: 1px solid var(--border);
}

/* ---------- Services grid ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.service-card {
  display: block;
  padding: 8px 40px;
  border-left: 1px solid var(--border);
}

.service-card:hover h3 {
  color: var(--accent-text);
}

.service-card:first-child {
  border-left: none;
  padding-left: 0;
}

.service-card:last-child {
  padding-right: 0;
}

.service-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-text);
  display: block;
  margin-bottom: 20px;
}

.service-card h3 {
  transition: color 0.15s ease;
}

@media (max-width: 820px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .service-card {
    border-left: none;
    padding: 0;
    border-top: 1px solid var(--border);
    padding-top: 40px;
  }

  .service-card:first-child {
    border-top: none;
    padding-top: 0;
  }
}

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

.site-footer {
  padding: 32px 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer .footer-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.site-footer .footer-location {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.site-footer .footer-legal,
.site-footer .footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-footer .footer-legal a,
.site-footer .footer-links a {
  display: inline-block;
  padding: 10px 6px;
  margin: -10px -6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.site-footer .footer-legal a:hover,
.site-footer .footer-links a:hover {
  color: var(--accent-text);
}

.site-footer .footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  margin: -10px -8px;
}

.social-icon {
  display: block;
  fill: currentColor;
  width: 16px;
  height: 16px;
}

.social-icon-x {
  width: 17px;
  height: 17px;
}

/* ---------- Legal pages (Privacy / Terms) ---------- */

.legal-content {
  max-width: 72ch;
}

.legal-content .legal-updated {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-caption);
  margin-bottom: 40px;
}

.legal-content h2 {
  font-size: 1.3125rem;
  margin-top: 44px;
  margin-bottom: 16px;
}

.legal-content h2:first-of-type {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.72;
  margin-bottom: 16px;
}

.legal-content ul {
  padding-left: 22px;
  margin: 0 0 16px;
}

.legal-content a {
  color: var(--accent-text);
  font-weight: 500;
}

/* ---------- Page header (About / Services / Contact) ---------- */

.page-header {
  padding: 80px 0 60px;
}

.page-header .eyebrow {
  margin-bottom: 22px;
}

.page-header p.lede {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 58ch;
  margin-top: 20px;
  line-height: 1.65;
}

.page-header h1.statement {
  font-size: clamp(2.2rem, 3.9vw, 3rem);
  max-width: 56ch;
  line-height: 1.35;
}

.page-header h1.wide {
  max-width: 30ch;
}

@media (max-width: 480px) {
  .page-header h1.wide {
    font-size: 2rem;
    max-width: none;
  }

  .page-header h1.statement {
    font-size: 1.9rem;
  }
}

/* ---------- About page ---------- */

.about-body {
  display: flex;
  gap: 80px;
  align-items: flex-start;
}

.about-body .col-label {
  flex-shrink: 0;
  width: 260px;
  position: sticky;
  top: 40px;
}

.about-body .col-main {
  max-width: 64ch;
}

.about-body .col-main p {
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 24px;
}

.about-body .col-main p:last-child {
  margin-bottom: 0;
}

.founder-portrait {
  margin: 24px 0 0;
  width: 100%;
  max-width: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: var(--surface);
}

.founder-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 1px;
}

@media (max-width: 820px) {
  .about-body {
    flex-direction: column;
    gap: 28px;
  }

  .about-body .col-label {
    width: auto;
    position: static;
  }

  .founder-portrait {
    max-width: 240px;
    margin-top: 20px;
  }
}


/* ---------- Services accordion (Services page) ---------- */

.services-accordion {
  padding: 0;
}

.service-row {
  border-top: 1px solid var(--border);
  background-color: transparent;
  transition: background-color 0.25s ease;
}

.service-row-heading {
  margin: 0;
  font: inherit;
}

.service-row-header {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.service-row-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.service-row-num {
  flex-shrink: 0;
  width: 72px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-caption);
  transition: color 0.25s ease;
}

.service-row-title {
  flex: 1;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  transition: color 0.25s ease;
}

.service-row-toggle {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-caption);
  transition: transform 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.service-row-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.35s ease, opacity 0.25s ease, visibility 0s linear 0.35s;
}

.service-row-panel > .container {
  overflow: hidden;
  min-height: 0;
}

.service-row-panel-inner {
  padding: 0 0 44px 104px;
  max-width: 68ch;
}

.service-summary {
  color: var(--text-secondary);
  font-size: 1.04rem;
  line-height: 1.7;
  margin: 0;
}

.service-row.is-open {
  background-color: rgba(var(--accent-rgb), 0.07);
}

.service-row.is-open .service-row-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 0.35s ease, opacity 0.25s ease;
}

.service-row.is-open .service-row-num,
.service-row.is-open .service-row-title {
  color: var(--accent-text);
}

.service-row.is-open .service-row-toggle {
  color: var(--accent-text);
  border-color: var(--accent-text);
  transform: rotate(45deg);
}

.no-js .service-row-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
}

.no-js .service-row-toggle {
  visibility: hidden;
}

@media (max-width: 820px) {
  .service-row-header-inner {
    gap: 18px;
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .service-row-num {
    width: auto;
  }

  .service-row-panel-inner {
    padding: 0 0 32px;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .service-row-num {
    display: none;
  }
}

/* ---------- Contact page ---------- */

.contact-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 80px;
  align-items: flex-start;
}

.contact-info {
  flex-shrink: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-info .info-block h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.contact-info .info-block p,
.contact-info .info-block a {
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color 0.15s ease;
}

.contact-info .info-block a:hover {
  color: var(--accent-text);
}

.contact-info .elsewhere-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.contact-info .elsewhere-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.contact-info .elsewhere-links .social-icon {
  width: 15px;
  height: 15px;
}

.contact-info .elsewhere-links .social-icon-x {
  width: 16px;
  height: 16px;
}

.contact-form {
  flex: 1;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-field {
  flex: 1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent-text);
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
  font-family: var(--font-sans);
}

.form-submit {
  margin-top: 8px;
  align-self: flex-start;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-form.is-sent {
  display: none;
}

.form-success,
.form-error {
  display: none;
  max-width: 560px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.98rem;
}

.form-success {
  flex: 1;
}

.form-error {
  flex: 1 1 100%;
  border-left: 3px solid var(--error-text);
}

.form-success.visible {
  display: block;
}

.form-resend {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.form-resend:hover,
.form-resend:focus-visible {
  color: var(--accent-text);
}

.form-error.visible {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
}

.form-error-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--error-text);
}

@media (max-width: 820px) {
  .contact-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }

  .contact-info {
    width: auto;
  }

  .contact-form,
  .form-success,
  .form-error {
    max-width: none;
  }

  .form-row {
    flex-direction: column;
    gap: 22px;
  }
}

/* ---------- Print ---------- */

@media print {
  .site-nav,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }

  .legal-content .legal-updated,
  .legal-content p,
  .legal-content li,
  .eyebrow {
    color: #000000 !important;
  }
}
