/* ---------------------------------------------------------------------------
   Sora-P page — single stylesheet for the whole site.
   No framework, no web fonts: every asset is served from this repository.
   --------------------------------------------------------------------------- */

:root {
  /* palette */
  --bg: #0c0e13;
  --surface: #141822;
  --surface-2: #1b2029;
  --border: #262c3a;
  --text: #e7eaf0;
  --muted: #98a1b3;
  --accent: #7c6cff;
  --accent-soft: rgba(124, 108, 255, 0.14);
  --accent-2: #35d6c0;

  /* spacing scale */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;

  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1080px;
  --prose: 46rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s4);
}

h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem);
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 var(--s4);
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

/* --- layout ---------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s5);
}

.section {
  padding: var(--s7) 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--s4);
  top: var(--s4);
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--s2) var(--s4);
  border-radius: var(--radius-sm);
}

/* --- header / footer ------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(12, 14, 19, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  min-height: 60px;
  padding-top: var(--s2);
  padding-bottom: var(--s2);
}

.brand {
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand .dot {
  color: var(--accent);
}

.site-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--s8);
  padding: var(--s6) 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  justify-content: space-between;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* --- hero ------------------------------------------------------------------ */

.hero {
  padding: var(--s8) 0 var(--s7);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60rem 26rem at 12% -10%, var(--accent-soft), transparent 70%),
    radial-gradient(40rem 20rem at 90% 0%, rgba(53, 214, 192, 0.09), transparent 70%);
}

.hero p.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 40rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 0 0 var(--s3);
}

/* --- tags & buttons -------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  list-style: none;
  margin: 0 0 var(--s4);
  padding: 0;
}

.tag {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin: var(--s5) 0 0;
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--surface);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c0e13;
}

.btn-primary:hover {
  background: #8f81ff;
  border-color: #8f81ff;
}

/* --- project cards --------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  margin-bottom: var(--s2);
}

.card-body h3 a {
  color: var(--text);
}

.card-body h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.card-body p {
  color: var(--muted);
  font-size: 0.95rem;
}

.card-links {
  margin-top: auto;
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  font-size: 0.85rem;
}

/* --- prose / legal pages --------------------------------------------------- */

.prose {
  max-width: var(--prose);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--s4);
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: var(--s2);
}

.prose h2 {
  margin-top: var(--s6);
  padding-top: var(--s2);
}

.prose h3 {
  margin-top: var(--s5);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin: var(--s5) 0 var(--s4);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--text);
}

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--s4) var(--s5);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 var(--s6);
}

.notice strong {
  color: var(--text);
}

.toc {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--s4) var(--s5);
  margin: 0 0 var(--s6);
}

.toc h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 var(--s3);
  padding: 0;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: var(--s5);
  font-size: 0.9rem;
}

.toc li {
  margin-bottom: var(--s1);
  break-inside: avoid;
}

/* --- tables ---------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 var(--s5);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  min-width: 30rem;
}

th,
td {
  text-align: left;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* --- misc ------------------------------------------------------------------ */

.cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--s6);
}

.legal-links {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--s5);
  margin: var(--s6) 0 0;
}

.legal-links h2 {
  margin-top: 0;
}

.center {
  text-align: center;
  padding: var(--s8) 0;
}

.stack-top {
  margin-top: var(--s6);
}

.center .btn-row {
  justify-content: center;
}

/* --- consent banner -------------------------------------------------------- */

/* The footer's "Cookie settings" control is a button, not a link, so it needs
   to be talked back into looking like the footer link beside it. */
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--text);
}

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: var(--s4) var(--s5);
  border-top: 1px solid var(--border);
  background: rgba(20, 24, 34, 0.97);
  backdrop-filter: blur(8px);
  animation: consent-in 0.2s ease-out;
}

.consent-inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4) var(--s5);
}

.consent-text {
  flex: 1 1 24rem;
  max-width: var(--prose);
}

.consent-text h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 var(--s2);
  padding: 0;
}

.consent-text h2:focus {
  outline: 2px solid var(--accent-2);
  outline-offset: 4px;
}

.consent-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

@keyframes consent-in {
  from {
    transform: translateY(100%);
  }

  to {
    transform: none;
  }
}

@media (max-width: 560px) {
  .site-header .wrap {
    align-items: flex-start;
  }

  .site-nav {
    margin-left: 0;
    width: 100%;
    gap: var(--s4);
    padding-bottom: var(--s2);
  }

  .toc ol {
    columns: 1;
  }

  .consent-actions .btn {
    flex: 1 1 8rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }

  .consent-banner {
    animation: none;
  }
}
