/* =========================================================
   1dayexploit — main styles
   palette:
     plum-deep   #4a3d48    (background)
     plum-muted  #6d5d6d    (borders, muted)
     plum-dark   #53404d    (card bg)
     cream       #dcd4bf    (foreground)
     orange      #ec5000    (accent primary)
     amber       #f2a201    (accent secondary)
     grey        #9e9e9e    (dim text)
   ========================================================= */

:root {
  --bg:        #4a3d48;
  --bg-card:   #53404d;
  --fg:        #dcd4bf;
  --fg-dim:    #9e9e9e;
  --border:    #6d5d6d;
  --accent:    #ec5000;
  --accent-2:  #f2a201;

  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Syne", "Space Grotesk", var(--font-sans);
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", "Fira Code", monospace;

  --maxw: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ========== landing (single-screen) ========== */
body.landing {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  position: relative;
}

/* ========== animated background (two layers + breathing) ========== */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-waves {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 150%;
  height: 135%;
  --px: 0px;
  --py: 0px;
  transform: translate3d(var(--px), var(--py), 0);
  background-repeat: repeat;
  will-change: transform, background-position, opacity;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='80' viewBox='0 0 160 80'><path d='M 0 60 L 20 40 L 40 60 L 60 40 L 80 60 L 100 40 L 120 60 L 140 40 L 160 60' fill='none' stroke='%236d5d6d' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'/><path d='M 0 40 L 20 20 L 40 40 L 60 20 L 80 40 L 100 20 L 120 40 L 140 20 L 160 40' fill='none' stroke='%236d5d6d' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter' opacity='0.6'/></svg>");
  animation: drift-a 38s linear infinite, breathe 14s ease-in-out infinite;
}

@keyframes drift-a {
  from { background-position: 0 0; }
  to   { background-position: -320px -160px; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.14; }
  50%      { opacity: 0.22; }
}

/* radial vignette keeps center readable */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(74, 61, 72, 0.55) 75%, rgba(74, 61, 72, 0.85) 100%);
  pointer-events: none;
}

/* ========== header / nav ========== */
.top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 2.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.brand img {
  height: 56px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.nav a {
  position: relative;
  padding: 0.25rem 0;
  color: var(--fg);
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.nav a:hover { opacity: 1; color: var(--accent-2); }
.nav a.active { opacity: 1; color: var(--fg); }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  opacity: 0.6;
  display: inline-block;
  margin: 0 -0.4rem;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  opacity: 0.75;
  padding: 4px;
  border-radius: 3px;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.nav-icon:hover {
  opacity: 1;
  color: var(--accent-2);
  background: rgba(220, 212, 191, 0.06);
}
.nav-icon svg { display: block; }

/* ========== main stage ========== */
.stage {
  position: relative;
  z-index: 5;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

/* ========== manifesto ========== */
.manifesto {
  max-width: 900px;
}

.manifesto h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.4em;
  white-space: nowrap;
}

.hero-prefix {
  color: var(--fg);
}

.hero-rotator {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.tw-cursor {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  background: var(--accent);
  margin-left: 4px;
  animation: caret 1s steps(1) infinite;
  flex-shrink: 0;
}

.tw-word {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

@keyframes caret {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.manifesto p {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--fg);
  opacity: 0.85;
  margin: 0;
  max-width: 62ch;
}

/* ========== repos (promoted to main area) ========== */
.repos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  max-width: 820px;
}

.repo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.2rem;
  background: rgba(83, 64, 77, 0.55);
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.repo:hover {
  border-color: var(--accent);
  background: rgba(83, 64, 77, 0.85);
  color: var(--fg);
  transform: translateY(-2px);
}

.repo-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.repo-name::before {
  content: "→";
  color: var(--accent);
  font-family: var(--font-mono);
}

.repo-desc {
  font-size: 0.88rem;
  opacity: 0.8;
  line-height: 1.45;
}

.repo-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-dim);
  margin-top: 0.2rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

.repo:hover .repo-meta { color: var(--accent); }

/* ========== recent research table ========== */
.recent {
  max-width: 100%;
}

.recent-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.notfound-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  margin: 0 0 1.2rem 0;
  color: var(--accent);
}
.recent-h1-meta {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

.recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.recent-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.recent-all {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  text-transform: lowercase;
  letter-spacing: 0.05em;
}
.recent-all:hover { color: var(--accent); }

.recent-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.recent-table tr {
  border-bottom: 1px solid rgba(109, 93, 109, 0.22);
  transition: background 0.15s ease;
  cursor: pointer;
}
.recent-table tr:last-child { border-bottom: none; }
.recent-table tr:hover { background: rgba(83, 64, 77, 0.45); }
.recent-table tr:hover .cell-arrow { color: var(--accent); transform: translateX(2px); }

.recent-table td {
  padding: 0.6rem 0.8rem;
  vertical-align: middle;
}
.recent-table td:first-child { padding-left: 0.3rem; }
.recent-table td:last-child  { padding-right: 0.3rem; text-align: right; }

.cell-date  { color: var(--fg-dim); white-space: nowrap; font-size: 0.82rem; width: 110px; }
.cell-cve   { color: var(--accent-2); white-space: nowrap; width: 160px; }
.cell-title { color: var(--fg); }
.cell-title a { color: inherit; }
.cell-poc   { width: 70px; text-align: center; }
.cell-gh    { width: 40px; text-align: right; padding-right: 0.4rem !important; }

.cell-gh a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-dim);
  padding: 4px;
  border-radius: 3px;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.cell-gh a:hover {
  color: var(--fg);
  background: rgba(220, 212, 191, 0.08);
  transform: translateY(-1px);
}

.badge-poc {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-poc-yes {
  color: var(--accent);
  background: rgba(236, 80, 0, 0.12);
  border-color: rgba(236, 80, 0, 0.4);
}

.badge-poc-pending {
  color: var(--fg-dim);
  background: rgba(158, 158, 158, 0.1);
  border-color: rgba(158, 158, 158, 0.3);
}

.recent-empty {
  padding: 1.2rem 0.4rem;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  text-align: center;
}

/* ========== search input (blog page) ========== */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.search-icon {
  position: absolute;
  left: 0.6rem;
  color: var(--fg-dim);
  pointer-events: none;
}

.search-input {
  background: rgba(83, 64, 77, 0.5);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem 0.4rem 1.9rem;
  width: 260px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input::placeholder { color: var(--fg-dim); opacity: 0.8; }

.search-input:focus {
  border-color: var(--accent);
  background: rgba(83, 64, 77, 0.75);
}

.search-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

@media (max-width: 560px) {
  .search-input { width: 180px; font-size: 0.78rem; }
}

/* ========== footer ========== */
.bottom {
  position: relative;
  z-index: 10;
  padding: 0.9rem 2.5rem 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.disclaimer {
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-left: 2px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(109, 93, 109, 0.25);
}

.bottom-left, .bottom-right {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.bottom .sep { opacity: 0.4; }

.bottom-right a {
  color: var(--fg-dim);
  border-bottom: 1px dashed transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.bottom-right a:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

/* ========== mobile ========== */
@media (max-width: 820px) {
  body.landing { overflow: auto; }
  .top { padding: 1rem 1.2rem; }
  .brand img { height: 44px; }
  .nav { gap: 1.2rem; font-size: 0.82rem; }
  .stage { padding: 1rem 1.2rem; gap: 1.5rem; }
  .bottom { padding: 0.9rem 1.2rem; }
  .repos { grid-template-columns: 1fr; }
  .cell-date  { width: auto; }
  .cell-cve   { width: auto; display: block; padding: 0 0.3rem 0.2rem !important; }
  .cell-date  { display: block; padding: 0.4rem 0.3rem 0 !important; }
  .recent-table td { padding: 0.4rem 0.3rem; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-waves { animation: none; }
  .tw-cursor { animation: none; }
}
