/* LaserCutReady.com Shared Design Tokens & Utility Classes
 * Matches the Tailwind v4 / Geist stone-50 + zinc-950 + amber-600/300 visual system.
 * Works offline via file:// and http:// with zero external font or CSS dependencies.
 */

:root {
  /* Core Surfaces & Text */
  --bg-page: #fafaf9;
  --bg-surface: #ffffff;
  --bg-muted: #f4f4f5;
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;

  /* Borders */
  --border-subtle: #e4e4e7;
  --border-strong: #d4d4d8;
  --border-input: #a1a1aa;

  /* Amber Accent */
  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;
  --accent-amber-text: #92400e;
  --accent-amber-badge: #fcd34d;
  --accent-amber-ring: #f59e0b;
  --accent-amber-focus: #b45309;

  /* Sky Info */
  --info-sky-bg: #f0f9ff;
  --info-sky-border: #bae6fd;
  --info-sky-text: #075985;

  /* Red Danger / Caution */
  --danger-red-bg: #fef2f2;
  --danger-red-border: #fca5a5;
  --danger-red-text: #991b1b;

  /* Typography */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Radii & Elevation */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-xs: 0 1px 2px 0 rgba(9, 9, 11, 0.05);
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

code,
pre,
kbd,
samp,
.lcr-mono {
  font-family: var(--font-mono);
}

/* Container & Layout */
.lcr-container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 480px) {
  .lcr-container {
    padding-inline: 1.25rem;
  }
}

.lcr-main {
  padding-block: 1.5rem 3rem;
}

@media (min-width: 768px) {
  .lcr-main {
    padding-block: 2rem 4rem;
  }
}

.lcr-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

@media (min-width: 640px) {
  .lcr-card {
    padding: 1.5rem;
  }
}

.lcr-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .lcr-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lcr-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .lcr-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lcr-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Buttons & Inputs (44px minimum touch target) */
.lcr-btn-primary,
.lcr-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.lcr-btn-primary {
  background-color: var(--text-primary);
  color: #ffffff;
  border: 1px solid var(--text-primary);
}

.lcr-btn-primary:hover {
  background-color: #27272a;
  border-color: #27272a;
}

.lcr-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lcr-btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.lcr-btn-secondary:hover {
  background-color: var(--bg-muted);
  border-color: var(--border-input);
}

.lcr-btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lcr-input,
.lcr-select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  background-color: var(--bg-page);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.lcr-input::placeholder {
  color: var(--text-muted);
}

.lcr-input[aria-invalid="true"] {
  border-color: var(--danger-red-text);
  background-color: var(--danger-red-bg);
}

.lcr-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.lcr-help {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Focus Accessibility */
.focus-ring:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-amber-focus);
  outline-offset: 2px;
}

/* Callouts */
.lcr-callout-amber,
.lcr-callout-sky,
.lcr-callout-red {
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.lcr-callout-amber {
  background-color: var(--accent-amber-bg);
  border-color: var(--accent-amber-border);
  color: var(--accent-amber-text);
}

.lcr-callout-sky {
  background-color: var(--info-sky-bg);
  border-color: var(--info-sky-border);
  color: var(--info-sky-text);
}

.lcr-callout-red {
  background-color: var(--danger-red-bg);
  border-color: var(--danger-red-border);
  color: var(--danger-red-text);
}

/* Badges */
.lcr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  background-color: var(--bg-muted);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.lcr-badge-amber {
  background-color: var(--accent-amber-bg);
  border-color: var(--accent-amber-border);
  color: var(--accent-amber-text);
}

.lcr-badge-sky {
  background-color: var(--info-sky-bg);
  border-color: var(--info-sky-border);
  color: var(--info-sky-text);
}

.lcr-badge-red {
  background-color: var(--danger-red-bg);
  border-color: var(--danger-red-border);
  color: var(--danger-red-text);
}

/* Tables */
.lcr-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lcr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}

.lcr-table th,
.lcr-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.lcr-table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--border-strong);
}

.lcr-table tbody tr:last-child td {
  border-bottom: none;
}

/* Screen-reader only */
.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 & Shared Site Shell */
.lcr-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background-color: var(--text-primary);
  color: #ffffff;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.lcr-skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.lcr-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.lcr-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-block: 0.75rem;
}

.lcr-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
}

.lcr-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-amber-ring);
  background-color: var(--text-primary);
  color: var(--accent-amber-badge);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lcr-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lcr-brand-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.lcr-brand-tagline {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--text-secondary);
}

.lcr-nav-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
}

.lcr-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.lcr-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.lcr-nav-link:hover {
  background-color: var(--bg-muted);
  color: var(--text-primary);
}

.lcr-nav-link[aria-current="page"],
.lcr-nav-link.is-active {
  background-color: var(--text-primary);
  color: #ffffff;
  font-weight: 600;
}

.lcr-nav-divider {
  width: 1px;
  height: 1.25rem;
  background-color: var(--border-subtle);
  display: none;
}

@media (min-width: 960px) {
  .lcr-nav-divider {
    display: inline-block;
  }
}

.lcr-nav-external {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.lcr-footer {
  margin-top: 2.5rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding-block: 1.75rem 2.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.lcr-footer-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.lcr-footer-links a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.lcr-footer-links a:hover {
  text-decoration-color: var(--text-primary);
}

.lcr-footer-disclaimer {
  margin: 0;
  padding: 0.75rem 1rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.lcr-footer-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.lcr-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.lcr-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.lcr-breadcrumb a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Print Rules (Clean A4 / Letter Worksheets) */
@media print {
  @page {
    margin: 0.5in;
  }

  html,
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  .no-print,
  #lcr-header,
  #lcr-footer,
  header[data-lcr-header],
  footer[data-lcr-footer],
  .lcr-header,
  .lcr-footer,
  .lcr-skip-link {
    display: none !important;
  }

  .lcr-container {
    max-width: none !important;
    padding-inline: 0 !important;
  }

  .lcr-main {
    padding-block: 0 !important;
  }

  .lcr-card {
    box-shadow: none !important;
    border: 1px solid #a1a1aa !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .lcr-callout-amber,
  .lcr-callout-sky,
  .lcr-callout-red {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #71717a !important;
  }

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