/* ======================================================================
   IMPERFECT AVIATORS - dcs.imperfectgaming.com
   Gritty military / stencil theme. Olive + amber + hazard. Self-contained:
   only stylesheet on the DCS pages; shared across index / roster / tacview /
   pilot views.
   ====================================================================== */

:root {
  --bg:        #14150e;
  --bg-2:      #1a1b12;
  --surface:   #20221a;
  --surface-2: #2a2c20;
  --rule:      rgba(216, 205, 160, 0.13);
  --rule-2:    rgba(216, 205, 160, 0.26);
  --ink:       #ece6d3;
  --ink-2:     #bdb79d;
  --ink-3:     #8a8770;
  --muted:     #6b6953;
  --amber:     #f4b821;
  --amber-2:   #d99a0a;
  --olive:     #9aa35e;
  --red:       #e3593b;
  --blue:      #6fa3d6;

  --font-stencil: "Black Ops One", Impact, system-ui, sans-serif;
  --font-cond:    "Oswald", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
  --font-body:    "Barlow", system-ui, sans-serif;

  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hazard: repeating-linear-gradient(-45deg, var(--amber) 0 16px, #100f08 16px 32px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
.d-body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.dwrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.amber { color: var(--amber); }
.mono { font-family: var(--font-mono); }
.ta-r { text-align: right; }
.hazard-bar { height: 8px; background: var(--hazard); }

h1, h2 { font-family: var(--font-stencil); color: var(--ink); line-height: 1.02; margin: 0; text-transform: uppercase; letter-spacing: 0.01em; font-weight: 400; }
h3 { font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); margin: 0; }

.dkicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 14px;
}
.dkicker::before { content: ""; width: 22px; height: 2px; background: var(--amber); }

/* ---------------------------- NAV ---------------------------- */
.dnav { position: sticky; top: 0; z-index: 50; background: rgba(20, 21, 14, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.dnav::before { content: ""; display: block; height: 4px; background: var(--hazard); opacity: 0.85; }
.dnav-row { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.dbrand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.dbrand:hover { text-decoration: none; }
.dbrand-mark {
  display: grid; place-items: center; width: 36px; height: 30px;
  background: var(--amber); color: #181206; font-family: var(--font-stencil); font-size: 13px;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}
.dbrand-txt { font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 18px; }
.dnav-links { display: flex; align-items: center; gap: 22px; }
.dnav-links a { color: var(--ink-2); font-family: var(--font-cond); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; }
.dnav-links a:hover { color: var(--amber); text-decoration: none; }
.dcta { background: var(--amber); color: #181206 !important; padding: 8px 16px; font-weight: 600; clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%); transition: background 0.2s var(--ease); }
.dcta:hover { background: var(--amber-2); text-decoration: none; }
.dburger { display: none; background: none; border: 1px solid var(--rule-2); color: var(--ink); width: 42px; height: 38px; border-radius: 4px; font-size: 20px; cursor: pointer; }

/* ---------------------------- HERO ---------------------------- */
.dhero { position: relative; padding: 96px 0 76px; overflow: hidden; }
.dhero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(180deg, rgba(20,21,14,0.55), rgba(20,21,14,0.93) 72%, var(--bg)),
    url('/img/dcs/hero-bg.jpg');
  background-size: cover; background-position: center; filter: saturate(0.85);
}
.dhero-inner { position: relative; z-index: 2; }
.dhero h1 { font-size: clamp(44px, 8vw, 96px); }
.dhero h1 .amber { color: var(--amber); }
.dhero-tag { font-family: var(--font-cond); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(16px, 2.4vw, 24px); color: var(--ink-2); margin: 12px 0 0; }
.dhero-lede { max-width: 600px; margin: 18px 0 0; font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-2); }
.dhero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.dstats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 44px; }
.dstat { background: rgba(20, 22, 14, 0.78); border: 1px solid var(--rule); border-left: 3px solid var(--amber); padding: 15px 12px; }
.dstat-v { display: block; font-family: var(--font-stencil); font-size: clamp(20px, 2.4vw, 30px); color: var(--amber); line-height: 1; }
.dstat-l { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------------------------- BUTTONS ---------------------------- */
.dbtn {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 22px;
  font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.dbtn:hover { text-decoration: none; transform: translateY(-2px); }
.dbtn-amber { background: var(--amber); color: #181206; }
.dbtn-amber:hover { background: var(--amber-2); }
.dbtn-ghost { border-color: var(--rule-2); color: var(--ink); clip-path: none; }
.dbtn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* ---------------------------- SECTIONS ---------------------------- */
.dsec { padding: 80px 0; }
.dsec-alt { background: var(--bg-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.dsec-head { margin-bottom: 32px; }
.dsec-head h2 { font-size: clamp(28px, 4.4vw, 48px); }
.dsec-head h2 .amber { color: var(--amber); }
.dnote { max-width: 660px; margin: 12px 0 0; color: var(--ink-3); font-size: 15.5px; }
.dnote strong { color: var(--ink-2); }
.dsec-head .more { float: right; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------------------------- PANELS / TABLES ---------------------------- */
.dpanel { background: var(--surface); border: 1px solid var(--rule); overflow: hidden; margin-top: 18px; }
.dpanel.is-empty { opacity: 0.7; }
.dpanel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule); background: rgba(0,0,0,0.18); }
.dpanel-title { font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber); font-size: 14px; }
.dpanel-count { font-family: var(--font-mono); font-size: 12px; color: var(--amber); border: 1px solid rgba(244, 184, 33, 0.4); padding: 2px 10px; }
.dpanel-note { display: none; margin: 0; padding: 16px 20px; color: var(--ink-3); font-style: italic; font-size: 14px; }
.dpanel.is-empty .dpanel-note { display: block; }
.dpanel.is-empty .dtable-wrap { display: none; }

.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding: 11px 20px; border-bottom: 1px solid var(--rule); }
.dtable td { padding: 12px 20px; border-bottom: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tbody tr { transition: background 0.15s var(--ease); }
.dtable tbody tr:hover { background: rgba(244, 184, 33, 0.05); }
.d-pilot { color: var(--ink); font-weight: 600; font-family: var(--font-cond); letter-spacing: 0.02em; }
a.d-pilot:hover { color: var(--amber); text-decoration: none; }
.d-empty td { color: var(--ink-3); font-style: italic; text-align: center; padding: 26px 20px; }

.d-side { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border: 1px solid var(--rule-2); }
.d-side-blue { color: var(--blue); border-color: rgba(111, 163, 214, 0.4); }
.d-side-red { color: var(--red); border-color: rgba(227, 89, 59, 0.45); }
.d-side-lobby { color: var(--ink-3); }

/* Leaderboard rank */
.d-rank { font-family: var(--font-stencil); color: var(--ink-3); width: 54px; }
.d-rank-1 { color: var(--amber); }
.d-rank-2 { color: #d8cdaf; }
.d-rank-3 { color: var(--amber-2); }

/* ---------------------------- SQUADRON / ABOUT ---------------------------- */
.dabout-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: center; }
.dabout-img { position: relative; }
.dabout-img img { border: 1px solid var(--rule-2); filter: saturate(0.9); }
.dabout-img::after { content: ""; position: absolute; left: -1px; bottom: -1px; width: 70px; height: 6px; background: var(--hazard); }
.dabout-body h2 { font-size: clamp(26px, 3.6vw, 44px); }
.dabout-body p { color: var(--ink-2); margin: 14px 0 0; }
.dchecks { list-style: none; margin: 20px 0 0; padding: 0; }
.dchecks li { position: relative; padding-left: 28px; margin: 10px 0; color: var(--ink-2); }
.dchecks li::before { content: "//"; position: absolute; left: 0; color: var(--amber); font-family: var(--font-mono); font-weight: 700; }

/* ---------------------------- MODS ---------------------------- */
.dmods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dmod { display: flex; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--amber); padding: 20px 22px; }
.dmod img { width: 60px; height: 60px; object-fit: contain; background: rgba(255,255,255,0.04); padding: 8px; flex: none; }
.dmod h3 { font-size: 17px; margin: 0 0 4px; }
.dmod p { margin: 0; color: var(--ink-3); font-size: 14px; }
.dmod-text { border-top-style: dashed; }

/* ---------------------------- HOW TO JOIN ---------------------------- */
.dsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dsteps li { background: var(--surface); border: 1px solid var(--rule); padding: 22px 24px; position: relative; }
.dstep-n { display: block; font-family: var(--font-stencil); font-size: 26px; color: var(--amber); margin-bottom: 8px; }
.dsteps h3 { font-size: 17px; margin: 0 0 6px; }
.dsteps p { margin: 0; color: var(--ink-3); font-size: 14.5px; }

/* ---------------------------- TACVIEW ---------------------------- */
.dtable-tv td.d-pilot { letter-spacing: 0.01em; }
.dtv-dl {
  font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 13px; color: var(--amber); border-bottom: 1px solid transparent;
}
.dtv-dl:hover { color: var(--amber-2); border-bottom-color: var(--amber-2); text-decoration: none; }

.dtv-toolbar { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: rgba(0, 0, 0, 0.12); }
.dtv-search, .dtv-filter {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--rule-2); color: var(--ink);
  font-family: var(--font-cond); font-size: 14px; letter-spacing: 0.02em; padding: 8px 12px;
  outline: none; transition: border-color 0.18s var(--ease);
}
.dtv-search { flex: 1; min-width: 0; }
.dtv-search::placeholder { color: var(--ink-3); }
.dtv-search:focus, .dtv-filter:focus { border-color: var(--amber); }
.dtv-filter { color: var(--ink); }
.dtv-filter option { background: var(--surface); color: var(--ink); }

.dtable-tv th.is-sortable { cursor: pointer; user-select: none; }
.dtable-tv th.is-sortable:hover { color: var(--amber); }
.dsort { display: inline-block; width: 10px; margin-left: 4px; font-family: var(--font-mono); font-size: 9px; color: var(--amber); }

@media (max-width: 560px) {
  .dtv-toolbar { flex-direction: column; }
}
.dwarn { margin: 0 0 24px; padding: 12px 16px; border-left: 3px solid var(--red); background: rgba(227, 89, 59, 0.08); color: var(--ink-2); font-size: 14px; }
.dwarn strong { color: var(--red); }

/* ---------------------------- GALLERY ---------------------------- */
.dgallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dshot { margin: 0; overflow: hidden; border: 1px solid var(--rule); aspect-ratio: 16 / 10; }
.dshot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); filter: saturate(0.9); }
.dshot:hover img { transform: scale(1.06); }

/* ---------------------------- CTA ---------------------------- */
.dcta-sec { background-size: cover; background-position: center; padding: 80px 0; text-align: center; border-top: 1px solid var(--rule); }
.dcta-inner h2 { font-size: clamp(26px, 4vw, 44px); }
.dcta-inner p { max-width: 520px; margin: 14px auto 24px; color: var(--ink-2); }

/* ---------------------------- SUB-PAGE HEADER ---------------------------- */
.dpagehead { padding: 70px 0 10px; }
.dpagehead .dcrumb { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.dpagehead .dcrumb a { color: var(--amber); }
.dpagehead h1 { font-size: clamp(34px, 6vw, 64px); }

/* ---------------------------- PILOT DETAIL ---------------------------- */
.dpilot-cs { display: inline-block; font-family: var(--font-mono); color: var(--amber); border: 1px solid var(--rule-2); padding: 4px 12px; letter-spacing: 0.1em; margin-bottom: 14px; }
.dpilot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 36px; }
.dpilot-card { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--amber); padding: 18px; }
.dpilot-card .v { display: block; font-family: var(--font-stencil); font-size: 30px; color: var(--ink); line-height: 1; }
.dpilot-card .l { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.dpilot-card.is-warn .v { color: var(--red); }
.dkills { display: grid; gap: 10px; max-width: 640px; }
.dkill-row { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: 12px; }
.dkill-label { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); font-size: 14px; }
.dkill-track { height: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--rule); }
.dkill-fill { height: 100%; background: var(--amber); }
.dkill-val { font-family: var(--font-mono); text-align: right; color: var(--ink); }

/* ---------------------------- FOOTER ---------------------------- */
.dfoot { border-top: 1px solid var(--rule); padding: 28px 0; background: var(--bg-2); }
.dfoot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.dfoot-links { display: flex; gap: 20px; }
.dfoot-links a { color: var(--ink-3); }
.dfoot-links a:hover { color: var(--amber); text-decoration: none; }

/* ---------------------------- RESPONSIVE ---------------------------- */
@media (max-width: 980px) {
  .dstats { grid-template-columns: repeat(4, 1fr); }
  .dmods, .dsteps { grid-template-columns: 1fr; }
  .dabout-grid { grid-template-columns: 1fr; gap: 26px; }
  .dgallery { grid-template-columns: repeat(2, 1fr); }
  .dpilot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .dnav-links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--rule); padding: 8px 24px 18px; display: none; }
  .dnav-links.open { display: flex; }
  .dnav-links a { padding: 13px 0; border-bottom: 1px solid var(--rule); }
  .dcta { text-align: center; margin-top: 12px; }
  .dburger { display: inline-flex; align-items: center; justify-content: center; }
  .dstats { grid-template-columns: repeat(2, 1fr); }
  .dkill-row { grid-template-columns: 100px 1fr 40px; }
}
