/* neeyik.info — shared stylesheet
   One file controls the look of every page. Colours live in the :root block. */

:root {
  --bg:        #111316;
  --surface:   #181b20;
  --surface-2: #1f2329;
  --surface-3: #262b32;
  --line:      #2d333b;
  --text:      #e7e9ec;
  --muted:     #98a1ab;
  --accent:    #f2b544;   /* amber, like an old phosphor display */
  --accent-2:  #ffd27a;

  /* vendor / category colours used in the timeline and charts */
  --red:     #ff5f57;
  --blue:    #4cc3ff;
  --green:   #5fe07a;
  --yellow:  #ffe066;
  --magenta: #f27bf0;
  --cyan:    #6ef0f0;

  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-top: 24px; padding-bottom: 48px; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

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

img { max-width: 100%; height: auto; }

.b { font-weight: 700; }
.i { font-style: italic; }
.tc { text-align: center; }
.tl { text-align: left; }
.tr { text-align: right; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(17, 19, 22, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-block: 12px;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 20px;
  color: var(--text); letter-spacing: -.02em;
}
.brand span { color: var(--accent); }
.brand:hover { color: var(--text); text-decoration: none; }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav a[aria-current="page"] { color: #16130b; background: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
  padding-block: 20px;
}

/* ---------- Tables (the bulk of the site) ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scrollbar-color: var(--surface-3) transparent;
}
.table-scroll:has(> .page-head) { border: 0; background: none; overflow: visible; }

table { border-collapse: collapse; width: 100%; }
td, th { padding: 6px 10px; vertical-align: middle; }

/* Page heading block: banner image + intro text + section links */
.page-head td { padding: 0; }
.page-head td:empty { display: none; }
.page-head .banner {
  display: block; width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.page-head td:not(:has(.banner)) { padding: 10px 14px; }
.page-head tr:not(:has(.banner)) > td { background: var(--surface); border: 1px solid var(--line); }
.page-head .bg-head, .page-head .bg-frame { background: var(--surface); }
.page-head tr:not(:has(.banner)):has(+ tr) > td { border-bottom: 0; }
.page-head { font-size: 14px; color: var(--text); }
.page-head a { font-weight: 600; }

/* Section-link and info panels */
.panel { font-size: 14px; }
.panel td { border-bottom: 1px solid var(--line); }
.panel tr:last-child td { border-bottom: 0; }
.panel .bg-frame, .panel .bg-head { background: var(--surface-2); }
.panel td:empty { padding: 0; border: 0; }
.panel a { display: inline-block; padding: 2px 0; font-weight: 600; }

/* Spec charts */
.data {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data td { border-bottom: 1px solid var(--line); border-right: 1px solid rgba(255,255,255,.03); }
.data td:empty { padding: 0; }
.data tr:hover > td:not([colspan]) { background: rgba(242, 181, 68, .07); }

/* row labels stay visible while you scroll across a wide chart */
.data tr > td:first-child:not([colspan]) {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  border-right: 1px solid var(--line);
}
.data tr:hover > td:first-child:not([colspan]) { color: var(--text); }

/* background tiers carried over from the original design */
.data .bg-frame { background: var(--surface-3); color: var(--text); font-weight: 700; }
.data .bg-head  { background: var(--surface-2); color: var(--accent); font-weight: 700;
                  text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.data .bg-alt   { background: #1c2026; }
.data tr > td.bg-frame:first-child, .data tr > td.bg-head:first-child { color: var(--accent); }

/* model-name header rows (bold rows of the lightest tier) */
.data tr:has(> td.bg-alt.b) > td { color: var(--text); background: var(--surface-3); }

.data td.prose, .panel td.prose { white-space: normal; min-width: 24ch; }
.data td { vertical-align: top; }

.link-missing { color: var(--muted); cursor: not-allowed; }

/* colour coding (timeline legend & highlights) */
.c-red     { color: var(--red); }
.c-blue    { color: var(--blue); }
.c-green   { color: var(--green); }
.c-yellow  { color: var(--yellow); }
.c-magenta { color: var(--magenta); }
.c-cyan    { color: var(--cyan); }

/* Timeline: one table per year, keep columns lined up */
.section-timeline .data { table-layout: fixed; white-space: normal; min-width: 900px; }
.section-timeline .data td:nth-child(1),
.section-timeline .data td:nth-child(2) { width: 64px; }
.section-timeline .table-scroll { margin-bottom: 10px; }

sup { font-size: .72em; color: var(--accent); }

/* ---------- Home page ---------- */
.hero { padding: 40px 0 28px; }
.hero h1 {
  font-size: clamp(28px, 4.5vw, 44px); line-height: 1.1; margin: 0 0 12px;
  letter-spacing: -.02em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 17px; max-width: 62ch; margin: 0; }
.hero .banner { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 28px; display: block; }

.cards {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 8px 0 32px;
}
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text);
  transition: border-color .15s, transform .15s, background .15s;
}
.card:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.card img { width: 60px; height: 40px; image-rendering: pixelated; border-radius: 4px; }
.card h2 { font-size: 18px; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 14px; }

.home-extras { display: grid; gap: 16px; grid-template-columns: 2fr 1fr; }
@media (max-width: 760px) { .home-extras { grid-template-columns: 1fr; } }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.box h2 { font-size: 15px; margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.box p { margin: 0; color: var(--muted); font-size: 14px; }

.search { display: flex; gap: 8px; margin-top: 12px; }
.search input[type="search"] {
  flex: 1; min-width: 0; padding: 9px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.search input[type="search"]:focus { border-color: var(--accent); outline: none; }
.btn, .search button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 9px 16px; border-radius: 8px; border: 0;
  background: var(--accent); color: #16130b;
}
.btn:hover, .search button:hover { background: var(--accent-2); }

@media (max-width: 600px) {
  body { font-size: 14px; }
  .site-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .site-nav a { white-space: nowrap; }
}

@media print {
  .site-header, .site-footer { display: none; }
  body { background: #fff; color: #000; }
  .table-scroll { overflow: visible; border: 0; }
  .data td { color: #000 !important; background: none !important; }
}

/* banner row: no box, no stray line break */
.page-head tr:has(.banner) > td { background: none !important; border: 0 !important; padding: 0; }
.banner + br { display: none; }

/* timeline: January rows mark the turn of a year rather than a section */
.section-timeline .data .bg-head {
  text-transform: none; letter-spacing: 0; font-size: inherit;
  background: var(--surface-2); color: inherit;
}
.section-timeline .data tr:has(> .bg-head) > td { border-bottom: 2px solid var(--accent); }
.section-timeline .data tr:has(> .bg-head) > td:nth-child(2) { color: var(--accent); }

/* small screens: let the page-heading link rows wrap instead of overflowing */
@media (max-width: 760px) {
  body:not(.section-cpuspecs) .page-head,
  body:not(.section-cpuspecs) .page-head tbody { display: block; }
  body:not(.section-cpuspecs) .page-head tr { display: flex; flex-wrap: wrap; }
  body:not(.section-cpuspecs) .page-head td { flex: 1 1 auto; text-align: center; }
  body:not(.section-cpuspecs) .page-head td[colspan] { flex-basis: 100%; }
  /* the CPU family grid keeps its AMD / Intel columns and scrolls sideways */
  .section-cpuspecs .table-scroll:has(> .page-head) { overflow-x: auto; }
  .section-home .hero { padding-top: 8px; }
  .data tr > td:first-child:not([colspan]) { white-space: normal; min-width: 130px; max-width: 160px; }
}
.section-timeline .panel { table-layout: fixed; min-width: 900px; }
.section-timeline .panel td:nth-child(1), .section-timeline .panel td:nth-child(2) { width: 64px; }
