/* ==========================================================================
   REC VHS Camera - Base Styles
   Reset, Typography, Utilities, and Micrographic Foundations
   ========================================================================== */

/* ==========================================================================
   Font Face Definitions
   ========================================================================== */

@font-face {
  font-family: 'VCR OSD Mono';
  src: url('../fonts/VCR_OSD_MONO_1.001.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono[wght].ttf') format('truetype');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   CSS Reset (Modern)
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  font-family: var(--font-body);
  font-size: var(--text-body-medium);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/* Display (VCR Font - for headlines) */
.text-display-large {
  font-family: var(--font-vcr);
  font-size: var(--text-display-large);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.text-display-medium {
  font-family: var(--font-vcr);
  font-size: var(--text-display-medium);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.text-display-small {
  font-family: var(--font-display);
  font-size: var(--text-display-small);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.text-display-tiny {
  font-family: var(--font-display);
  font-size: var(--text-display-tiny);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* Body (JetBrains Mono) */
.text-body-large {
  font-family: var(--font-body);
  font-size: var(--text-body-large);
  line-height: var(--leading-relaxed);
}

.text-body-medium {
  font-family: var(--font-body);
  font-size: var(--text-body-medium);
  line-height: var(--leading-normal);
}

.text-body-small {
  font-family: var(--font-body);
  font-size: var(--text-body-small);
  line-height: var(--leading-normal);
}

.text-caption {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  line-height: var(--leading-normal);
}

/* Micrographic Typography */
.text-micro {
  font-family: var(--font-body);
  font-size: var(--text-micro);
  line-height: 1.3;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.text-nano {
  font-family: var(--font-body);
  font-size: var(--text-nano);
  line-height: 1.2;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.text-vcr {
  font-family: var(--font-vcr);
}

/* Color Utilities */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-accent { color: var(--color-accent); }

/* Tracking Utilities */
.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-wider { letter-spacing: var(--tracking-wider); }
.tracking-widest { letter-spacing: var(--tracking-widest); }
.tracking-ultra { letter-spacing: var(--tracking-ultra); }

/* Weight Utilities */
.weight-light { font-weight: var(--weight-light); }
.weight-regular { font-weight: var(--weight-regular); }
.weight-medium { font-weight: var(--weight-medium); }
.weight-semibold { font-weight: var(--weight-semibold); }
.weight-bold { font-weight: var(--weight-bold); }

/* Case Utilities */
.uppercase { text-transform: uppercase; }
.normal-case { text-transform: none; }

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-content {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-section) 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-xxl { gap: var(--space-xxl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Full-bleed utility */
.full-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* ==========================================================================
   Micrographic Components
   ========================================================================== */

/* Data strip - full-width thin band with dense spec text */
.data-strip {
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--white-12);
  border-bottom: 1px solid var(--white-12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxl);
  font-family: var(--font-body);
  font-size: var(--text-micro);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--white-30);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.data-strip::-webkit-scrollbar {
  display: none;
}

.data-strip span {
  flex-shrink: 0;
}

/* Boxed text - enclosed labels like batch numbers */
.boxed-text {
  display: inline-block;
  border: 1px solid var(--white-20);
  padding: var(--space-xxs) var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-micro);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  line-height: 1;
  color: var(--white-60);
}

.boxed-text--amber {
  border-color: var(--amber-40);
  color: var(--color-accent);
}

/* Tick-mark divider */
.tick-divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--white-20);
  font-size: var(--text-nano);
  letter-spacing: var(--tracking-ultra);
  text-transform: uppercase;
  user-select: none;
}

.tick-divider::before,
.tick-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--white-08);
}

/* Section numbering style */
.section-number {
  font-family: var(--font-body);
  font-size: var(--text-micro);
  color: var(--white-30);
  letter-spacing: var(--tracking-ultra);
  text-transform: uppercase;
}

.section-number span {
  color: var(--color-accent);
}

/* CSS-only barcode visual */
.css-barcode {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 24px;
}

.css-barcode span {
  display: block;
  background: var(--white-20);
}

.css-barcode span:nth-child(odd) { width: 2px; }
.css-barcode span:nth-child(even) { width: 1px; }
.css-barcode span:nth-child(3n) { width: 1px; height: 80%; }
.css-barcode span:nth-child(5n) { width: 3px; }
.css-barcode span:nth-child(7n) { height: 70%; }
.css-barcode span:nth-child(11n) { width: 2px; height: 60%; }

/* ==========================================================================
   Selection
   ========================================================================== */

::selection {
  background-color: var(--color-accent);
  color: var(--color-background);
}

/* ==========================================================================
   Scrollbar (WebKit)
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--white-12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--white-20);
}

/* ==========================================================================
   Focus Styles
   ========================================================================== */

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

/* ==========================================================================
   Responsive Visibility
   ========================================================================== */

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile-only {
    display: none !important;
  }
}
