/* ─── GT Machine Shop Theme Variables ───────────────────────────── */
:root {
  /* LIGHT MODE (Birch Wood & Light Steel) */
  --bg-main: #f0ede6;       /* Light workshop table */
  --bg-panel: #ffffff;      /* Clean tool stations */
  --bg-hover: #e5e2da;      
  --border: #c8c2b5;        
  --border-strong: #a19a8d;
  
  --text-main: #003057;     /* GT Navy */
  --text-secondary: #3b5a76;
  --text-muted: #6b7c8c;
  
  --accent-gold: #B3A369;   /* GT Tech Gold */
  --accent-gold-hover: #9c8e59;
  --accent-navy: #003057;   /* Primary button color */
  --accent-navy-hover: #002240;

  --moss: #2E7D32;          /* Success green */
  --crimson: #C62828;       /* Error red */
  
  --dropzone-bg: rgba(0, 48, 87, 0.04);
  --dropzone-border: #B3A369;
  
  --grid-color: rgba(0, 48, 87, 0.05);

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Manrope', system-ui, sans-serif;
  --mono:  'JetBrains Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  /* DARK MODE (Gunmetal & Walnut) */
  --bg-main: #141619;       /* Dark gunmetal */
  --bg-panel: #1e2126;      /* Equipment housing */
  --bg-hover: #272b31;
  --border: #353a42;
  --border-strong: #4f5661;
  
  --text-main: #e2e6eb;     /* Off-white/silver text */
  --text-secondary: #a3adb8;
  --text-muted: #737f8d;
  
  --accent-gold: #EAAA00;   /* Buzz Gold (pops better on dark) */
  --accent-gold-hover: #c99300;
  --accent-navy: #5e8bb0;   /* Lightened navy for dark mode contrast */
  --accent-navy-hover: #7ea3c2;
  
  --moss: #66BB6A;
  --crimson: #EF5350;

  --dropzone-bg: rgba(234, 170, 0, 0.04);
  --dropzone-border: #EAAA00;
  
  --grid-color: rgba(255, 255, 255, 0.03);
}

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

html, body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Industrial Grid & Grain */
body {
  position: relative;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 31px, var(--grid-color) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, var(--grid-color) 31px 32px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px 80px;
  position: relative;
  z-index: 1;
}

/* ─── Header ───────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--border-strong);
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand .seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border: 2px solid var(--accent-gold);
  border-radius: 4px; /* More industrial square vs circle */
  position: relative;
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--border-strong);
  transition: all 0.3s;
}

.brand-text { display: flex; flex-direction: column; gap: 2px; }

.logo {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--text-main);
  text-shadow: 1px 1px 0px var(--bg-main), 2px 2px 0px var(--border);
}

.logo .amp {
  color: var(--accent-gold);
  font-weight: 500;
  font-style: italic;
}

.tagline {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.status-bar {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.status-bar .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--moss);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  box-shadow: 0 0 6px var(--moss);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-panel);
  border-radius: 50%;
  width: 36px; height: 36px;
}
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ─── Hero ─────────────────────────────── */
.hero {
  margin-bottom: 48px;
  max-width: 760px;
  position: relative;
}

.section-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}
.section-no::before {
  content: '';
  display: inline-block;
  width: 32px; height: 2px;
  background: var(--accent-gold);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 58px;
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: var(--text-main);
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-gold);
}

.hero p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 640px;
  line-height: 1.65;
}

.hero p code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-navy);
  background: var(--bg-hover);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* ─── Drop zone ────────────────────────── */
.dropzone {
  position: relative;
  background: var(--dropzone-bg);
  border: 2px dashed var(--border-strong);
  padding: 68px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 36px;
  border-radius: 4px;
}

.dropzone:hover,
.dropzone.drag-over {
  background: var(--bg-hover);
  border-color: var(--dropzone-border);
  border-style: solid;
}

.dropzone.drag-over .drop-icon {
  transform: translateY(-4px);
}

.dropzone-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.drop-icon {
  width: 52px; height: 52px;
  color: var(--accent-gold);
  stroke-width: 1.5;
  transition: transform 0.2s ease;
}

.drop-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.012em;
}

.drop-sub {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.drop-sub kbd {
  display: inline-block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--accent-gold);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  margin: 0 3px;
  vertical-align: 1px;
}

input[type="file"] { display: none; }

/* ─── Batch bar + file list ────────────── */
.batch-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  flex-wrap: wrap;
  gap: 10px;
}

.batch-bar.active { display: flex; }

.batch-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.batch-info .count {
  color: var(--accent-gold);
  font-weight: 700;
}

.batch-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.file-list {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  margin-bottom: 40px;
  border-radius: 0 0 4px 4px;
}

.file-list.active { display: block; }

.file-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  background: var(--bg-panel);
}

.file-row:last-child { border-bottom: 0; border-radius: 0 0 4px 4px; }
.file-row:hover { background: var(--bg-hover); }

.file-icon {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
}

.file-info { min-width: 0; }

.file-name {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.file-meta {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.format-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

.format-select-wrap .arrow {
  color: var(--accent-gold);
  font-weight: 700;
}

.format-select {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 7px 28px 7px 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: all 0.15s;
}

[data-theme="light"] .format-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23536473' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.format-select:hover { border-color: var(--accent-gold); background-color: var(--bg-hover); }
.format-select:focus { outline: none; border-color: var(--accent-gold); }
.format-select:disabled { opacity: 0.4; cursor: not-allowed; }

.status-cell {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  min-width: 96px;
  text-align: right;
  font-weight: 600;
}

.status-cell.pending { color: var(--text-muted); }
.status-cell.working { color: var(--accent-gold); }
.status-cell.done    { color: var(--moss); }
.status-cell.error   { color: var(--crimson); }

.status-cell .spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--accent-gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.file-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--bg-main);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--text-main);
  background: var(--bg-hover);
}

.icon-btn.download {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.icon-btn.download:hover {
  background: var(--accent-gold);
  color: #141619; /* High contrast dark for hover text */
}

.icon-btn svg { width: 14px; height: 14px; }

/* ─── Buttons ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 9px 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 var(--border-strong);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--border-strong);
}

.btn:hover {
  background: var(--bg-hover);
  color: var(--accent-gold);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }

.btn.primary {
  background: var(--accent-navy);
  color: #ffffff;
  border-color: var(--accent-navy);
  box-shadow: 2px 2px 0 var(--border-strong);
}
[data-theme="light"] .btn.primary { color: #ffffff; }

.btn.primary:hover {
  background: var(--accent-navy-hover);
  color: #ffffff;
}

.btn.accent {
  background: var(--accent-gold);
  color: #141619;
  border-color: var(--accent-gold);
}
.btn.accent:hover { background: var(--accent-gold-hover); color: #141619; }

/* ─── Capabilities ─────────────────────── */
.capabilities {
  margin-top: 90px;
  padding-top: 0;
}

.cap-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-strong);
}

.cap-header h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.cap-header .cap-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  font-weight: 700;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  background: var(--border);
  border: 1px solid var(--border);
  gap: 1px;
  border-radius: 4px;
  overflow: hidden;
}

.cap-card {
  background: var(--bg-panel);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: background 0.2s;
}

.cap-card:hover {
  background: var(--bg-hover);
}

.cap-card .cap-num {
  position: absolute;
  top: 14px; right: 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.cap-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.cap-card .formats {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.75;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cap-card .formats b {
  color: var(--accent-gold);
  font-weight: 700;
}

/* ─── Toast ────────────────────────────── */
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-gold);
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-main);
  min-width: 240px;
  pointer-events: auto;
  animation: slidein 0.3s ease;
  letter-spacing: 0.04em;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
  border-radius: 3px;
}

[data-theme="light"] .toast { box-shadow: 4px 4px 0 var(--border-strong); }

.toast.error   { border-left-color: var(--crimson); }
.toast.success { border-left-color: var(--moss); }

@keyframes slidein {
  from { transform: translate(20px, 5px); opacity: 0; }
  to   { transform: translate(0, 0);     opacity: 1; }
}

/* ─── Footer ───────────────────────────── */
footer {
  margin-top: 88px;
  padding-top: 24px;
  border-top: 2px solid var(--border-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

footer a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid transparent; }
footer a:hover { color: var(--accent-gold); border-bottom-color: var(--accent-gold); }

/* ─── Responsive ───────────────────────── */
@media (max-width: 720px) {
  .container { padding: 32px 20px 60px; }
  header { flex-direction: column; align-items: flex-start; gap: 18px; }
  .header-controls { width: 100%; justify-content: space-between; }
  .hero h1 { font-size: 40px; }
  .logo { font-size: 38px; }
  .dropzone { padding: 50px 20px; }
  .drop-title { font-size: 24px; }
  .cap-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cap-header h2 { font-size: 26px; }
  .file-row {
    grid-template-columns: 36px 1fr;
    grid-template-areas: "icon info" "select select" "status actions";
    gap: 12px;
    padding: 14px 16px;
  }
  .file-icon { grid-area: icon; }
  .file-info { grid-area: info; }
  .format-select-wrap { grid-area: select; justify-content: space-between; }
  .status-cell { grid-area: status; text-align: left; }
  .file-actions { grid-area: actions; justify-self: end; }
  .batch-bar { flex-direction: column; gap: 12px; align-items: stretch; }
  footer { flex-direction: column; gap: 12px; align-items: flex-start; }
}