@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --red: #e8000d;
  --red-dark: #8a0008;
  --red-dim: rgba(232,0,13,0.15);
  --chrome: #c8cdd6;
  --chrome-dim: #6b7280;
  --bg: #0a0a0b;
  --bg2: #111114;
  --bg3: #18181c;
  --border: rgba(200,205,214,0.12);
  --border-red: rgba(232,0,13,0.35);
  --text: #e8eaed;
  --text-dim: #8b8f99;
  --mono: 'Share Tech Mono', monospace;
  --display: 'Orbitron', sans-serif;
  --body: 'DM Sans', sans-serif;
  --glow: 0 0 20px rgba(232,0,13,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.07) 2px,
    rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo .pokeball {
  width: 28px; height: 28px;
  background: conic-gradient(#fff 0deg 180deg, var(--red) 180deg 360deg);
  border-radius: 50%;
  border: 2.5px solid var(--chrome);
  position: relative;
  flex-shrink: 0;
}
.nav-logo .pokeball::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 7px; height: 7px;
  background: var(--chrome);
  border-radius: 50%;
  border: 1.5px solid #444;
}

.nav-wordmark {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}
.nav-wordmark span { color: var(--red); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
  text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.active { color: var(--red); }

.nav-cta {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 20px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: background 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { background: #ff1a24; box-shadow: var(--glow); }

/* PAGE WRAPPER */
.page { padding-top: 64px; }

/* HERO */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 80px 40px;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
}

.hero-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.hero-label::before, .hero-label::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--red);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 7vw, 86px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.hero h1 .accent { color: var(--red); display: block; }

.hero-sub {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin: 24px 0 48px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: var(--mono);
  font-size: 13px;
  padding: 14px 36px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: #ff1a24; box-shadow: var(--glow); transform: translateY(-1px); }

.btn-secondary {
  font-family: var(--mono);
  font-size: 13px;
  padding: 14px 36px;
  background: transparent;
  color: var(--chrome);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--chrome-dim); background: rgba(200,205,214,0.06); }

/* STATS BAR */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  padding: 28px 40px;
  display: flex;
  justify-content: center;
  gap: 80px;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  display: block;
}
.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* FEATURES */
.section {
  padding: 100px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 60px;
  line-height: 1.1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.feature-card {
  background: var(--bg2);
  padding: 36px 32px;
  transition: background 0.2s;
}
.feature-card:hover { background: var(--bg3); }

.feature-icon {
  width: 44px; height: 44px;
  background: var(--red-dim);
  border: 1px solid var(--border-red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 20px;
}

.feature-card h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* PSA STANDARDS TABLE */
.standards-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
  margin-top: 40px;
}
.standards-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--red);
  border-bottom: 1px solid var(--border-red);
  text-transform: uppercase;
}
.standards-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.standards-table tr:hover td { background: var(--bg3); color: var(--text); }
.grade-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--display);
}
.g10 { background: rgba(0,204,102,0.15); color: #00cc66; border: 1px solid rgba(0,204,102,0.3); }
.g9  { background: rgba(102,204,255,0.15); color: #66ccff; border: 1px solid rgba(102,204,255,0.3); }
.g8  { background: rgba(255,204,0,0.15); color: #ffcc00; border: 1px solid rgba(255,204,0,0.3); }

/* HOW IT WORKS */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-top: 20px;
}
.step { position: relative; }
.step-num {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}
.step h3 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
.step p { font-size: 14px; color: var(--text-dim); line-height: 1.7; }

/* CTA BAND */
.cta-band {
  background: var(--bg2);
  border-top: 1px solid var(--border-red);
  border-bottom: 1px solid var(--border-red);
  padding: 80px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at 50% 50%, rgba(232,0,13,0.08), transparent);
}
.cta-band h2 {
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  position: relative;
  margin-bottom: 16px;
}
.cta-band p {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 36px;
  position: relative;
}

/* FOOTER */
footer {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.footer-brand span { color: var(--red); }
.footer-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--chrome-dim);
  letter-spacing: 0.06em;
}

/* TOOL PAGE */
.tool-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 40px 40px 0;
  max-width: 1000px;
  margin: 0 auto;
}
.tool-header h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.tool-header p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tool-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px;
}

/* GRADER TOOL STYLES */
#upload-zone {
  border: 2px dashed rgba(232,0,13,0.3);
  border-radius: 8px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg2);
  margin-bottom: 24px;
  transition: border-color 0.2s, background 0.2s;
}
#upload-zone:hover { border-color: var(--red); background: rgba(232,0,13,0.04); }
#upload-zone p { color: var(--text-dim); font-family: var(--mono); font-size: 13px; margin-top: 12px; letter-spacing: 0.06em; }
#upload-zone .upload-icon { font-size: 40px; color: var(--red); opacity: 0.6; }
#file-input { display: none; }
#editor { display: none; }
#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
#toolbar label { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; }
#toolbar button {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
#toolbar button:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
#rot-display { font-family: var(--mono); font-size: 12px; color: var(--red); min-width: 44px; }

#canvas-wrap { position: relative; display: inline-block; cursor: crosshair; user-select: none; }
canvas { display: block; border-radius: 6px; border: 1px solid var(--border); }

#loupe {
  position: fixed;
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 2.5px solid var(--red);
  pointer-events: none;
  display: none;
  overflow: hidden;
  box-shadow: var(--glow), 0 4px 30px rgba(0,0,0,0.8);
  z-index: 9999;
}
#loupe-canvas { position: absolute; top: 0; left: 0; }
#crosshair-h { position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: rgba(232,0,13,0.7); transform: translateY(-50%); }
#crosshair-v { position: absolute; left: 50%; top: 0; height: 100%; width: 1px; background: rgba(232,0,13,0.7); transform: translateX(-50%); }

#results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.rcard {
  background: var(--bg2);
  border-radius: 6px;
  padding: 16px 20px;
  border: 1px solid var(--border);
}
.rcard .rlabel { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.rcard .rval { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--text); }
.rcard .rgrade { font-family: var(--mono); font-size: 12px; margin-top: 4px; }

#verdict {
  grid-column: 1 / -1;
  padding: 14px 20px;
  border-radius: 6px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
}

#overlay-badge {
  position: absolute;
  background: rgba(10,10,11,0.88);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  min-width: 160px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

#export-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s;
}
#export-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ABOUT PAGE */
.about-hero {
  padding: 100px 40px 60px;
  max-width: 800px;
  margin: 0 auto;
}
.about-hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 24px;
}
.about-hero p {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 80px;
}
.about-section h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.about-section p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-red);
  color: var(--red);
  background: var(--red-dim);
}

/* RESPONSIVE */
@media (max-width: 640px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .hero { padding: 60px 20px; }
  .stats-bar { gap: 40px; padding: 28px 20px; }
  .section { padding: 60px 20px; }
  footer { padding: 30px 20px; }
  .tool-wrap, .tool-header { padding: 20px; }
  #results { grid-template-columns: 1fr; }
  #results .rcard:last-child { grid-column: 1; }
}

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.cursor-blink { animation: blink 1s step-end infinite; }
