/* ==========================================================================
   SteelPro — homepage design tokens & base
   ========================================================================== */

:root {
  --ink: #0b0d10;
  --charcoal: #14171b;
  --panel: #1b1f24;
  --line: #2a2e34;
  --paper: #f4f4f2;
  --muted: #9aa0a8;
  --accent: #eab308;
  --on-accent: #0b0d10;
  --danger: #f87171;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --ink: #f7f6f3;
  --charcoal: #ede9e2;
  --panel: #ffffff;
  --line: #ddd9d1;
  --paper: #16181c;
  --muted: #5b5f66;
  --accent: #b45309;
  --danger: #dc2626;
}

* { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }

/* Header and footer stay permanently dark in both themes — the logo art has
   light text baked into the PNG, so this chrome can't follow the page theme. */
.site-header,
.site-footer {
  --ink: #0b0d10;
  --charcoal: #14171b;
  --panel: #1b1f24;
  --line: #2a2e34;
  --paper: #f4f4f2;
  --muted: #9aa0a8;
  --accent: #eab308;
}

* , *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 1152px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background: var(--charcoal);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  position: relative;
  padding-block: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--paper); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--charcoal);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 200ms ease;
  }
  .main-nav.is-open { max-height: 500px; }
  .main-nav a,
  .main-nav .nav-feedback-btn {
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    text-align: left;
  }
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.logo-white { color: var(--paper); }
.logo-accent { color: var(--accent); }
.logo-img { display: block; height: 48px; width: auto; }
.logo-img-footer { height: 44px; }

.cart-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.cart-fab:hover { filter: brightness(1.08); }
.cart-fab-count {
  background: var(--ink);
  color: var(--accent);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  padding-inline: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
@media (max-width: 560px) {
  .cart-fab { left: 16px; bottom: 16px; padding: 12px 18px; }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
  font-weight: 600;
}
.main-nav a { color: var(--muted); transition: color 150ms ease; }
.main-nav a:hover { color: var(--paper); }
.nav-feedback-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease;
}
.nav-feedback-btn:hover { color: var(--paper); }

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}
.cart-badge[hidden] { display: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 12px 24px;
}
.btn-accent { background: var(--accent); color: var(--on-accent); }
/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  background-color: var(--charcoal);
  border-bottom: 1px solid var(--line);
  padding-block: 80px;
}
.hero-bar { width: 40px; height: 2px; background: var(--accent); margin-bottom: 24px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.25rem;
  text-transform: uppercase;
  color: var(--paper);
  max-width: 36rem;
  line-height: 1.15;
  margin: 0;
}
.hero-lede { color: var(--muted); margin: 16px 0 0; max-width: 28rem; }
.hero .btn { margin-top: 32px; }

/* ==========================================================================
   Product categories
   ========================================================================== */

.categories { padding-block: 64px; }
.categories h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 32px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.category-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 150ms ease;
}
.category-card:hover { border-color: var(--accent); }
.category-icon { width: 32px; height: 32px; color: var(--accent); }
.category-card span { font-weight: 700; color: var(--paper); }

@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .category-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Stats
   ========================================================================== */

.stats { padding-block: 64px; border-top: 1px solid var(--line); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.stats-grid:has(.stat:only-child) { grid-template-columns: 1fr; max-width: 20rem; margin-inline: auto; }
.stat-num { font-family: var(--font-mono); font-weight: 700; font-size: 1.875rem; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CTA
   ========================================================================== */

.cta { background-color: var(--charcoal); border-top: 1px solid var(--line); }
.cta-inner { padding-block: 64px; text-align: center; }
.cta h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 12px;
}
.cta p { color: var(--muted); margin: 0 auto 32px; max-width: 28rem; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--line);
  margin-top: 64px;
}
.footer-inner {
  padding-block: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ==========================================================================
   Motion & texture
   ========================================================================== */

.hero, .cta {
  position: relative;
  background-image:
    radial-gradient(ellipse at top right, rgba(234, 179, 8, 0.07), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: no-preference) {
  .hero-bar,
  .hero h1,
  .hero-lede,
  .hero .btn {
    opacity: 0;
    animation: reveal-up 600ms ease-out forwards;
  }
  .hero-bar { animation-delay: 0ms; }
  .hero h1 { animation-delay: 80ms; }
  .hero-lede { animation-delay: 160ms; }
  .hero .btn { animation-delay: 240ms; }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Products page
   ========================================================================== */

.products-page { padding-block: 64px; }
.products-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 32px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}
.filter-tabs a {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 8px 16px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.filter-tabs a.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-photo {
  width: calc(100% + 40px);
  height: 160px;
  margin: -20px -20px 0;
  object-fit: cover;
  background: var(--paper);
}
.product-card h3 { margin: 0; color: var(--paper); font-size: 1rem; font-weight: 700; }
.product-spec { margin: 0; color: var(--muted); font-size: 0.875rem; flex: 1; }
.product-price { margin: 0; color: var(--paper); font-size: 0.875rem; }
.product-price span { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.product-price-pending { color: var(--muted); font-style: italic; }
.product-add-btn { border: none; cursor: pointer; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Quote page
   ========================================================================== */

.quote-page { padding-block: 64px; }
.quote-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 32px;
}

.quote-empty, .quote-sent { color: var(--muted); }
.quote-sent { color: var(--accent); }
.link-accent { color: var(--accent); text-decoration: underline; }

.quote-lines { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }
.quote-line {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.quote-line-name { color: var(--paper); font-weight: 700; }
.quote-line-spec { color: var(--muted); font-size: 0.875rem; }
.quote-line-controls { display: flex; align-items: center; gap: 12px; }
.quote-qty-input {
  width: 64px;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 4px 8px;
}
.quote-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
}
.quote-remove-btn:hover { color: var(--danger); }

/* Shared form field styles (also used on the contact page) */
.quote-form, .contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 28rem;
}
.field-input, .field-textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 10px 16px;
  font: inherit;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--muted); }
.form-status { font-size: 0.875rem; color: var(--danger); margin: 0; }
.form-status.is-success { color: var(--accent); }

/* ==========================================================================
   About page
   ========================================================================== */

.wrap-narrow { max-width: 720px; }

.about-page { padding-block: 64px; }
.about-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 24px;
}
.about-page p { color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.about-page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 40px 0 16px;
}
.about-page ul { color: var(--muted); padding-left: 20px; margin: 0; }
.about-page li { margin-bottom: 4px; }

/* ==========================================================================
   Contact page
   ========================================================================== */

.contact-page { padding-block: 64px; }
.contact-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 24px;
}
.contact-info { color: var(--muted); margin: 0 0 24px; }
.contact-info p { margin: 0 0 4px; }

/* ==========================================================================
   Feedback modal
   ========================================================================== */

.feedback-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.feedback-modal-overlay[hidden] { display: none; }
.feedback-modal {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  max-width: 28rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}
.feedback-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.feedback-modal-close:hover { color: var(--paper); }
.feedback-modal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 8px;
}
.feedback-modal > p { color: var(--muted); margin: 0 0 20px; font-size: 0.875rem; }
.feedback-category-group { display: flex; gap: 12px; margin-bottom: 12px; }
.feedback-category-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 12px;
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
}
.feedback-category-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.feedback-category-error {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.875rem;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-left: 3px solid var(--danger);
}
.feedback-category-error[hidden] { display: none; }

/* ==========================================================================
   Theme toggle
   ========================================================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 760px) {
  .main-nav .theme-toggle { margin: 14px 24px 0; }
}

/* ==========================================================================
   Accessibility & polish
   ========================================================================== */

/* Keyboard focus. There were no :focus rules at all before this, so keyboard
   users got whatever the browser drew. --accent is themed, so this ring
   follows light/dark automatically. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
/* Accent-coloured controls need a ring that isn't the accent colour. */
.btn-accent:focus-visible,
.filter-tabs a.is-active:focus-visible,
.cart-badge:focus-visible {
  outline-color: var(--paper);
}

/* Skip link — hidden until focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 0; }
main:focus { outline: none; }

/* Formspree honeypot. Positioned off-screen rather than display:none so that
   naive bots still fill it in; anything that POSTs to the endpoint directly
   bypasses this, which is what the dashboard spam filter is for. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Remove button was bare text at a ~20px tap target. */
.quote-remove-btn {
  padding: 10px 12px;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* On a narrow screen the spec text wrapped to four lines while the quantity
   input and Remove got crushed against the right edge. Stack instead. */
@media (max-width: 560px) {
  .quote-line {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .quote-line-controls { justify-content: space-between; }
  .quote-qty-input { width: 96px; padding: 8px; }
}

/* --------------------------------------------------------------------------
   Contrast fixes (measured, WCAG 2.1 AA)
   -------------------------------------------------------------------------- */

/* Light mode kept --on-accent at the dark ink while --accent became #b45309,
   which put near-black on dark amber at 3.87:1 — under the 4.5 minimum, on
   every primary button on the site. White on that amber measures 5.02:1. */
[data-theme="light"] { --on-accent: #ffffff; }

/* The header and footer pin the dark palette, so they keep the dark accent
   (#eab308) in both themes and therefore must keep the dark on-accent too —
   otherwise the light-mode override above would put white on yellow there. */
.site-header,
.site-footer { --on-accent: #0b0d10; }

/* Form field borders were 1.43:1 (dark) and 1.30:1 (light) against the page —
   WCAG 1.4.11 wants 3:1 for input boundaries. Scoped to fields only so the
   decorative card and panel borders keep their intended softness. */
:root { --field-line: #646c78; }
[data-theme="light"] { --field-line: #877f70; }
.field-input,
.field-textarea,
.quote-qty-input {
  border-color: var(--field-line);
}

/* Hidden twins that let Netlify discover the JavaScript-built forms. */
.form-detection { display: none; }

/* ==========================================================================
   Georgian (ka)
   ========================================================================== */

/* The language toggle, sitting beside the theme toggle. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Oswald, Source Sans 3 and IBM Plex Mono carry no Georgian glyphs at all, so
   without this the whole page silently falls back to a system face. Mono keeps
   Plex first so Latin digits stay monospaced; Georgian characters fall back to
   Noto per glyph. */
:root:lang(ka) {
  --font-display: "Noto Sans Georgian", "Sylfaen", "BPG Arial", sans-serif;
  --font-body: "Noto Sans Georgian", "Sylfaen", "BPG Arial", sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans Georgian", ui-monospace, monospace;
}

/* Mkhedruli has no capitals. `text-transform: uppercase` is wrong here for three
   separate reasons: Blink (Chrome, Edge) does not perform the Mkhedruli->Mtavruli
   mapping at all, the Google Fonts CDN strips the OpenType `case` feature that
   would otherwise do it, and Mtavruli is display-only typography that does not
   belong on buttons and nav items. Recover the emphasis with weight and spacing. */
:lang(ka) h1, :lang(ka) h2, :lang(ka) h3, :lang(ka) h4,
:lang(ka) .btn, :lang(ka) .main-nav a, :lang(ka) .nav-feedback-btn,
:lang(ka) .filter-tabs a, :lang(ka) .category-card span,
:lang(ka) .stat-label, :lang(ka) .skip-link, :lang(ka) .lang-toggle,
:lang(ka) .product-add-btn, :lang(ka) .quote-remove-btn,
:lang(ka) .feedback-category-btn, :lang(ka) .form-status {
  text-transform: none;
}

/* Oswald's tight tracking was tuned for condensed Latin caps. Georgian at the
   same tracking reads cramped, and it never wants the extra letter-spacing that
   uppercase Latin labels do. */
:lang(ka) h1, :lang(ka) h2, :lang(ka) h3 { letter-spacing: 0; line-height: 1.18; }
:lang(ka) .btn, :lang(ka) .main-nav a, :lang(ka) .nav-feedback-btn,
:lang(ka) .filter-tabs a, :lang(ka) .stat-label { letter-spacing: 0.01em; }

/* Georgian has no ascender/descender rhythm like Latin and reads a touch small
   at the same size. A small bump and a little more leading, nothing dramatic. */
:lang(ka) body { font-size: 1.05rem; line-height: 1.62; }
:lang(ka) .main-nav a, :lang(ka) .nav-feedback-btn { font-size: 0.9375rem; }

/* Georgian strings run longer than the English they replace, so anything that
   was sized to the English label needs room to breathe or wrap. */
:lang(ka) .btn { padding-inline: 20px; }
:lang(ka) .filter-tabs { row-gap: 8px; }
:lang(ka) .category-card span { hyphens: none; overflow-wrap: anywhere; }

/* Georgian quotation marks are low-opening / high-closing. */
:lang(ka) q { quotes: "\201E" "\201C"; }

/* Governing-language note: carries text only in Georgian, so it collapses in English. */
.lang-note:empty { display: none; }
.lang-note { font-size: 0.875rem; color: var(--muted); border-left: 2px solid var(--accent);
             padding-left: 14px; margin: 0 0 26px; }
