/* ============================================================================
   Structure Technology — Corporate Identity stylesheet
   Palette  : Void Black #000 (70%) · Cosmic Bordeaux #8B1F38 (22%) · Stellar White #FFF (8%)
   Type     : Space Grotesk (display) · Inter (body) · JetBrains Mono (accent)
   The brand faces are self-hosted variable fonts (wwwroot/lib/fonts/fonts.css,
   OFL-licensed) so typography matches the identity document exactly while the
   CSP stays default-src 'self'. Fallback stacks below cover the load window.
   ============================================================================ */

:root {
  --void: #000000;
  --void-2: #0a0a0c;
  --void-3: #121216;
  --bordeaux: #8b1f38;
  --bordeaux-bright: #b3324f;
  --stellar: #ffffff;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --muted: rgba(255, 255, 255, 0.62);
  --muted-2: rgba(255, 255, 255, 0.42);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;

  --max: 1200px;
  --gap: clamp(1rem, 2vw, 2rem);
  --radius: 2px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--stellar);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--bordeaux-bright); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { margin: 0 0 1rem; color: var(--muted); }
strong { color: var(--stellar); font-weight: 500; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--bordeaux-bright);
  display: inline-block;
  margin-bottom: 1rem;
}

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section + .section { border-top: 1px solid var(--line); }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.brand__mark { width: 26px; height: auto; display: block; }
.brand__sub { color: var(--muted-2); font-size: 0.62rem; letter-spacing: 0.28em; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.8rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}

.nav__links a:hover,
.nav__links a.active { color: var(--stellar); border-color: var(--bordeaux); }

.nav__meta { display: flex; align-items: center; gap: 1rem; }
.lang-switch { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; color: var(--muted-2); }
.lang-switch a.active { color: var(--stellar); }

/* Hamburger — hidden on desktop, shown by the mobile media query below. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--stellar);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--stellar);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn:hover { border-color: var(--bordeaux-bright); color: var(--stellar); }
.btn--primary { background: var(--bordeaux); border-color: var(--bordeaux); }
.btn--primary:hover { background: var(--bordeaux-bright); border-color: var(--bordeaux-bright); }
.btn--ghost { color: var(--muted); }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding-block: clamp(4rem, 12vw, 9rem); }
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.hero__glow {
  position: absolute; width: 520px; height: 520px; right: -120px; top: -120px;
  background: radial-gradient(circle, rgba(139, 31, 56, 0.45), transparent 65%);
  filter: blur(20px); pointer-events: none;
}
.hero__inner { position: relative; max-width: 46rem; }
.hero h1 span { color: var(--bordeaux-bright); }
.hero__lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 38rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ---- Values / grid cards ---- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  background: linear-gradient(180deg, var(--void-2), var(--void));
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card__index { font-family: var(--font-mono); color: var(--bordeaux-bright); font-size: 0.8rem; letter-spacing: 0.18em; }
.card h3 { margin-top: 0.6rem; }
.card p { margin-bottom: 0; font-size: 0.95rem; }

/* ---- Project grid ---- */
.projects { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.project-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--void-2);
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--bordeaux); transform: translateY(-3px); }
.project-card__cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--void-3), #1c1220);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line);
}
.project-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.project-card__body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.project-card__meta { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--muted-2); text-transform: uppercase; }
.project-card h3 { margin: 0; font-size: 1.3rem; }
.project-card p { font-size: 0.9rem; margin: 0; }
.project-card__foot { margin-top: auto; padding-top: 0.8rem; display: flex; align-items: center; justify-content: space-between; }

.badge {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.25rem 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted);
}
.badge--live { color: var(--bordeaux-bright); border-color: var(--bordeaux); }
.badge--featured { color: var(--stellar); border-color: var(--bordeaux-bright); background: rgba(139, 31, 56, 0.2); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.tag-list li {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted);
}

/* ---- Project detail ---- */
.detail__header { border-bottom: 1px solid var(--line); padding-bottom: 2rem; margin-bottom: 2rem; }
.detail__cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.detail__block { margin-bottom: 2rem; }
.detail__aside { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; position: sticky; top: 96px; }
.detail__aside dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin-top: 1rem; }
.detail__aside dd { margin: 0.2rem 0 0; }
.outcomes { list-style: none; margin: 0; padding: 0; }
.outcomes li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 0.7rem; }
.outcomes li::before { content: "→"; color: var(--bordeaux-bright); }

/* ---- Bend the Time (Manifesto VII) ---- */
.bend-figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: linear-gradient(180deg, var(--void-2), var(--void)); }
.bend-figure svg { width: 100%; height: auto; display: block; }
.bend-figure figcaption { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.8rem; text-align: center; }
.bend-label { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.3em; fill: var(--stellar); }
.bend-label--muted { fill: var(--muted-2); }
.bend-label--accent { fill: var(--bordeaux-bright); letter-spacing: 0.18em; }

/* ---- Brand page (Marka) ---- */
.master-mark {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  background:
    radial-gradient(circle at 50% 18%, rgba(139, 31, 56, 0.22), transparent 60%),
    linear-gradient(180deg, var(--void-2), var(--void));
}
.master-mark img { width: clamp(120px, 22vw, 180px); height: auto; }

.concept-card { display: flex; gap: 1.4rem; align-items: flex-start; }
.concept-card__mark {
  flex: 0 0 auto; width: 108px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--void);
  padding: 10px;
}
.concept-card__mark img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.concept-card__sub { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em; color: var(--muted-2); vertical-align: middle; margin-left: 0.5rem; }

/* Authentic 01–08 comparison strip from the brand catalog. */
.timeline-strip {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(0.6rem, 2vw, 1.2rem);
  background: linear-gradient(90deg, var(--void), var(--void-2), var(--void));
}
.timeline-strip img { width: 100%; height: auto; display: block; }

.swatch__chip { height: 84px; border-radius: var(--radius); margin-bottom: 1.1rem; }
.usage { display: grid; gap: 0.6rem; max-width: 44rem; }
.usage .mono { font-size: 0.72rem; letter-spacing: 0.2em; }
.usage__bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; }
.usage__seg { display: block; height: 100%; }

.type-spec__sample { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin: 0.5rem 0 0.7rem; }
.type-spec__glyphs { font-size: 0.78rem; letter-spacing: 0.14em; overflow-wrap: anywhere; }

/* ---- Manifesto / prose ---- */
.prose { max-width: 42rem; }
.prose p { font-size: 1.08rem; }
.prose blockquote {
  border-left: 2px solid var(--bordeaux); margin: 2rem 0; padding-left: 1.4rem;
  font-family: var(--font-display); font-size: 1.4rem; color: var(--stellar); line-height: 1.3;
}

/* ---- Forms ---- */
.form { max-width: 40rem; display: grid; gap: 1.2rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--stellar);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
}
.field input:focus,
.field textarea:focus,
.field select:focus { outline: none; border-color: var(--bordeaux-bright); }
.field textarea { min-height: 160px; resize: vertical; }
.field--honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-validation-error, .validation-summary-errors { color: var(--bordeaux-bright); font-size: 0.85rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.checkbox { display: flex; align-items: center; gap: 0.6rem; }
.checkbox input { width: auto; }

/* ---- Toasts ---- */
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: grid; gap: 0.6rem; z-index: 80; max-width: 22rem; }
.toast {
  border: 1px solid var(--line-strong); border-left-width: 3px; border-radius: var(--radius);
  background: var(--void-3); padding: 0.9rem 1.1rem; font-size: 0.9rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast--success { border-left-color: var(--bordeaux-bright); }
.toast--error { border-left-color: #e0425f; }
.toast--info { border-left-color: var(--muted); }
.toast--warning { border-left-color: #d8a24a; }

/* ---- Footer ---- */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); padding-block: 3rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.site-footer .muted { color: var(--muted-2); font-size: 0.85rem; }
.site-footer .mono { font-family: var(--font-mono); letter-spacing: 0.16em; font-size: 0.72rem; text-transform: uppercase; }

/* ---- Stats row ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.stat__num { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }
.stat__label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin-top: 0.5rem; }

/* ---- Admin ---- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin__side { border-right: 1px solid var(--line); padding: 1.5rem; background: var(--void-2); }
.admin__side h2 { font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; }
.admin__nav { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.admin__nav a { display: block; padding: 0.6rem 0.8rem; border-radius: var(--radius); color: var(--muted); font-size: 0.9rem; }
.admin__nav a:hover, .admin__nav a.active { background: var(--void-3); color: var(--stellar); }
.admin__main { padding: clamp(1.5rem, 3vw, 2.5rem); overflow-x: auto; }
.admin__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); }
.table th { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.table tr:hover td { background: var(--void-2); }
.table .actions { display: flex; gap: 0.5rem; }
.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.7rem; }

.inline-form { display: inline; }

/* ---- Utilities ---- */
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 1rem; }

@media (max-width: 860px) {
  .detail__cols { grid-template-columns: 1fr; }
  .detail__aside { position: static; }
  .admin { grid-template-columns: 1fr; }
  .admin__side { border-right: none; border-bottom: 1px solid var(--line); }

  .nav { flex-wrap: wrap; }
  .nav-toggle { display: flex; order: 3; }
  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    gap: 0;
    order: 5;
    width: 100%;
    padding-block: 0.5rem 1rem;
    border-top: 1px solid var(--line);
  }
  .nav__links.open a { display: block; padding: 0.8rem 0.2rem; font-size: 0.95rem; }
  /* The wrapping <nav> is a plain flow container: when the list is closed it has zero height. */
  .nav > nav { order: 5; width: 100%; }
}
