/* alphabell.ca — hand-written stylesheet, no framework */

:root {
  --bg: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-2: #7c3aed;
  --field-border: #cbd5e1;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  /* .hero::before bleeds to the viewport edges; never let it create horizontal scroll */
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 66rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a { color: inherit; }

/* ---- Accessibility ---- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { left: 1rem; }

main:focus { outline: none; }

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

.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark:hover { color: var(--accent); }

.site-header nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  font-size: 0.875rem;
}
@media (min-width: 640px) {
  .site-header nav ul { gap: 1.75rem; }
}

.site-header nav a {
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
  padding: 0.375rem 0;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] {
  color: var(--accent);
}

/* ---- Type & sections ---- */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.display em,
.display-sm em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.display-sm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2.title, h3.title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero {
  position: relative;
  padding-block: 5rem;
}
@media (min-width: 640px) { .hero { padding-block: 7rem; } }

/* Subtle engineering-grid texture behind the hero, fading out downward */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 85%);
}

.section {
  border-top: 1px solid var(--line);
  padding-block: 4rem;
}
@media (min-width: 640px) { .section { padding-block: 5rem; } }

.muted { color: var(--ink-soft); }
.measure { max-width: 42rem; }
.measure-wide { max-width: 48rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 2.5rem; }
.mt-6 { margin-top: 3rem; }

.row-between {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

/* ---- Buttons & links ---- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.3rem;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.btn-outline:hover { border-color: var(--ink); background: #f8fafc; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
}

.text-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.text-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---- Cards (Work) ---- */

.cards {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card h3, .card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
a.card:hover h3 { color: var(--accent); }

.card .meta, .meta {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}

.card p:not(.meta) { margin-top: 1rem; color: var(--ink-soft); font-size: 0.95rem; }

/* ---- Work page entries ---- */

.work-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  background: var(--bg);
}
.work-entry + .work-entry { margin-top: 1.5rem; }

.work-entry h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.work-entry .body { margin-top: 1.25rem; max-width: 44rem; color: var(--ink-soft); }

/* ---- Process list (Services) ---- */

.process {
  list-style: none;
  counter-reset: step;
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.process li {
  counter-increment: step;
  position: relative;
  max-width: 44rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.25rem 4.25rem;
}

.process li::before {
  content: "0" counter(step);
  position: absolute;
  left: 1.25rem;
  top: 1.35rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.process strong { font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }
.process span { color: var(--ink-soft); font-size: 0.95rem; }

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

.form-grid { display: grid; gap: 1.25rem; max-width: 42rem; }

@media (min-width: 640px) {
  .form-grid .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.field .optional {
  color: var(--ink-soft);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field textarea { min-height: 9rem; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.notice {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  max-width: 42rem;
  font-size: 0.9375rem;
}
.notice a { color: inherit; font-weight: 600; }
.notice-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.notice-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ---- Legal prose ---- */

.prose { max-width: 44rem; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  margin-top: 2.5rem;
  letter-spacing: -0.02em;
}
.prose p, .prose ul { margin-top: 1rem; color: var(--ink-soft); }
.prose ul { padding-left: 1.25rem; }
.prose a { color: var(--accent); }

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

.site-footer {
  margin-top: 6rem;
  background: var(--ink);
  color: #e2e8f0;
}

.site-footer .wrap { padding-block: 3rem; }

.wordmark-footer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.footer-row {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
}
@media (min-width: 640px) {
  .footer-row {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
