/* c4file.com — Blueprint Grid theme.
   Light-only, mobile-first, WCAG 2.1 AA color contrast, Section 508 friendly. */

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

:root{
  color-scheme: light;
  --bg: #EEF3F8;
  --grid: rgba(30,64,120,.07);
  --card: #FDFEFE;
  --ink: #0D1B2A;         /* 14.9:1 on --bg */
  --body: #1A2A3F;        /* 12.2:1 on --bg */
  --muted: #445266;       /* 7.6:1 on --bg */
  --accent: #1E40A8;      /* deep royal blue */
  --accent-ink: #0F2664;  /* darker tone for text on accent backgrounds */
  --line: #B9CBDE;
  --danger: #B42318;
  --ok: #047857;
  --radius: 4px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, Liberation Mono, monospace;
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

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

body{
  font-family: var(--font);
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--body);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.mono { font-family: var(--mono); }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

code { font-family: var(--mono); background: rgba(30,64,120,.06); padding: 1px 6px; border-radius: 3px; font-size: .92em; }
kbd { font-family: var(--mono); background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; padding: 1px 6px; border-radius: 3px; font-size: .88em; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Centered axis: keep all home-page content on a single narrow central column.
   Headers still use the wide wrap; only main gets the centered axis. */
.wrap.centered { max-width: 760px; }
.wrap.centered .meta-strip,
.wrap.centered .trust-strip { margin-left: auto; margin-right: auto; }

/* Accessibility primitives */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: absolute; left: 8px; top: 8px; width: auto; height: auto; padding: 8px 16px; background: var(--accent); color: #fff; z-index: 1000; border-radius: var(--radius); font-weight: 600; }
.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; }

/* Header */
header { padding: 16px 0; }
.head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand::before { content: "▲ "; color: var(--accent); font-size: 14px; }
header nav { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
header nav a { font-size: 14px; color: var(--muted); text-decoration: none; padding: 10px 4px; display: inline-flex; align-items: center; min-height: 24px; }
header nav a:hover, header nav a:focus-visible { color: var(--accent); }

/* Hero */
.hero { padding: 48px 0 32px; text-align: center; }
.coord { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .08em; margin-bottom: 12px; }
h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 600; letter-spacing: -.02em; line-height: 1.08; max-width: 24ch; margin: 0 auto 20px; color: var(--ink); }
.lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--body); max-width: 64ch; margin: 0 auto 36px; line-height: 1.55; }
.hero .panel.converter { margin-left: auto; margin-right: auto; text-align: left; }

/* Blueprint panel with crosshair corners */
.panel { background: var(--card); border: 1px solid var(--line); position: relative; }
.panel-corners::before, .panel-corners::after,
.panel::before, .panel::after {
  content: "+"; position: absolute; color: var(--accent); font-family: var(--mono); font-size: 14px; line-height: 1;
}
.panel::before { top: -7px; left: -7px; }
.panel::after  { top: -7px; right: -7px; }
.panel-corners::before { bottom: -7px; right: -7px; top: unset; left: unset; }
.panel-corners::after  { bottom: -7px; left: -7px;  top: unset; right: unset; }

/* Converter */
.converter { padding: 28px; max-width: 680px; }

.drop { display: block; width: 100%; padding: clamp(32px, 6vw, 56px) 24px; border: 1px dashed var(--line); background: var(--bg); cursor: pointer; text-align: center; position: relative; transition: background 150ms; min-height: 120px; }
.drop::before { content: ""; position: absolute; inset: 6px; border: 1px solid transparent; pointer-events: none; transition: border-color 150ms; }
.drop:hover, .drop[data-hover="true"] { background: rgba(30,64,120,.03); }
.drop:hover::before, .drop[data-hover="true"]::before, .drop:focus-within::before { border-color: var(--accent); }
.drop strong { display: block; font-weight: 600; font-size: 18px; margin-bottom: 8px; color: var(--ink); }
.drop .muted { display: block; color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.drop .source { display: block; font-family: var(--mono); color: var(--muted); font-size: 11px; letter-spacing: .04em; }

/* Format picker — radio-button semantics via aria-pressed */
.fmts { display: flex; gap: 0; margin-top: 18px; border: 0; padding: 0; }
.fmts legend { margin: 0; }
.fmts button { flex: 1; font-family: var(--mono); padding: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; margin-left: -1px; font-size: 13px; letter-spacing: .04em; color: var(--body); min-height: 44px; min-width: 64px; }
.fmts button:first-child { margin-left: 0; }
.fmts button:hover:not([aria-pressed="true"]) { background: var(--bg); }
.fmts button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); position: relative; z-index: 1; font-weight: 500; }

/* Queue and status */
.queue { margin-top: 20px; display: grid; gap: 4px; max-height: 280px; overflow-y: auto; padding-right: 4px; }
.qrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; align-items: center; }
.qname { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.qstate { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.qstate[data-ok="true"] { color: var(--ok); }
.qstate[data-err="true"] { color: var(--danger); }
.qdownload {
  font-family: var(--mono); font-size: 11px; padding: 8px 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); border-radius: 3px; cursor: pointer;
  letter-spacing: .04em; text-transform: uppercase;
  min-height: 32px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
/* Hover fills with --ink (deep navy, nearly black) so the button darkens
 * instead of shifting hue to blue — reads more like a primary action on a
 * dark brand than a link. */
.qdownload:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.qdownload[hidden] { display: none; }

#status { display: block; margin-top: 14px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--body); min-height: 1.2em; word-break: break-word; }
#status:empty::before { content: "Ready. Drop files above to begin."; color: var(--muted); }

/* Trust strip */
/* All three hero blocks (converter, trust, meta) share this width so their
 * edges line up under the blueprint corner marks. */
.trust-strip { margin-top: 28px; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; max-width: 680px; }
.trust-strip li { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--body); }
.trust-strip a.tile-link,
.trust-strip a.tile-link:hover,
.trust-strip a.tile-link:focus-visible { display: block; margin: -12px -14px; padding: 12px 14px; color: inherit; text-decoration: none; min-height: 100%; }
.trust-strip strong { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--accent); display: block; margin-bottom: 2px; font-weight: 600; }

/* Meta strip (three columns, ITAR-aware / bulk / local) */
.meta-strip { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 680px; }
.meta-strip .panel { padding: 24px; }
.meta-strip a.panel,
.meta-strip a.panel:hover,
.meta-strip a.panel:focus-visible { display: block; color: inherit; text-decoration: none; }
.meta-strip h3 { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; font-weight: 500; }
.meta-strip p { font-size: 14px; color: var(--body); line-height: 1.65; }

/* Long-form prose sections */
.prose { margin: 80px auto 0; max-width: 720px; }
.prose h2 { font-size: clamp(24px, 3.5vw, 32px); font-weight: 600; letter-spacing: -.02em; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--ink); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; justify-content: center; text-align: center; }
.prose h2::before { content: attr(data-num); font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; font-weight: 500; }
.prose p, .prose ol, .prose ul.sources { margin-bottom: 14px; color: var(--body); font-size: 16px; }
.prose ol { padding-left: 24px; }
.prose ol li { margin-bottom: 8px; }
.prose .lead { margin-bottom: 24px; text-align: center; }
.page-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; }
.page-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; border-radius: var(--radius); }
.page-actions a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-actions a:hover { border-color: var(--accent); background: rgba(30,64,120,.04); }
.page-actions a.primary:hover { background: var(--ink); border-color: var(--ink); }
.related-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 18px; }
.related-links a { display: block; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; }
.related-links a:hover { border-color: var(--accent); background: rgba(30,64,120,.03); }

.prose ul.sources { list-style: none; padding: 0; margin: 16px 0; }
.prose ul.sources li { padding: 10px 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; display: grid; grid-template-columns: 90px 1fr; gap: 14px; align-items: baseline; }
.prose ul.sources li strong { font-family: var(--mono); color: var(--accent); font-size: 12px; letter-spacing: .06em; font-weight: 600; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; padding: 16px; background: var(--card); border: 1px solid var(--line); font-size: 14px; margin: 16px 0; }
.kv dt { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .08em; padding-top: 2px; font-weight: 600; }
.kv dd { color: var(--body); }

details { background: var(--card); border: 1px solid var(--line); margin-bottom: 6px; padding: 14px 18px; }
details summary { cursor: pointer; font-weight: 500; font-size: 15px; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 10px; min-height: 28px; }
details summary::before { content: "+"; font-family: var(--mono); color: var(--accent); font-weight: 700; }
details[open] summary::before { content: "−"; }
details p { margin-top: 10px; color: var(--body); font-size: 14px; }
details summary::-webkit-details-marker { display: none; }

/* Footer */
footer { margin-top: 80px; padding: 20px 0; border-top: 1px solid var(--line); background: var(--card); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover, .foot nav a:focus-visible { color: var(--accent); }

/* --- Responsive tweaks --- */

/* iPad portrait + mobile landscape */
@media (max-width: 820px) {
  .meta-strip { margin-top: 48px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-top: 8px; }
  .kv dd + dt { border-top: 1px dashed var(--line); padding-top: 10px; }
}

/* Mobile portrait */
@media (max-width: 520px) {
  body { background-size: 24px 24px; }
  .wrap { padding: 0 16px; }
  header { padding: 12px 0; }
  header nav { gap: 14px; }
  header nav a { font-size: 13px; }
  .hero { padding: 32px 0 24px; }
  .converter { padding: 20px; }
  .drop { padding: 32px 16px; }
  .fmts button { padding: 12px 6px; font-size: 12px; }
  .prose { margin-top: 56px; }
  .prose ul.sources li { grid-template-columns: 1fr; gap: 4px; }
  .foot { justify-content: flex-start; }
}

/* Print */
@media print {
  header, footer, .drop, .fmts, .queue, #status, .trust-strip { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .panel::before, .panel::after, .panel-corners::before, .panel-corners::after { display: none; }
}

/* High contrast mode (Windows) */
@media (forced-colors: active) {
  .panel, .panel-corners { forced-color-adjust: none; }
  .fmts button[aria-pressed="true"] { border: 2px solid; }
}
