/* Case study pages, standalone stylesheet.
   These pages are plain static HTML, served without the React bundle, so a
   crawler that does not run JavaScript still gets the full text. Palette,
   typography and the button treatment follow the ObliqueX design system
   (src/index.css); if the design system moves, this file moves with it.

   Unlike the KelimeYAP legal pages, the type here is the site's own
   self-hosted Open Runde and Geist rather than a system stack, because the
   copy is English only and the latin subsets cover it. */

@font-face {
  font-family: "Open Runde";
  src: url("/fonts/open-runde-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: 210 16% 5%;
  --foreground: 0 0% 98%;
  --surface: 210 14% 8%;
  --muted-foreground: 0 0% 55%;
  --border: 210 10% 14%;
  --primary: 205 42% 60%;
  --radius: 0.625rem;

  --display: "Open Runde", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.02em;
}

.wrap {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

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

.topbar {
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 4rem;
}

.topbar-inner {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}

/* Matches the site navigation: 28px mark, then the wordmark set in display
   type, so returning to obliquex.com never looks like leaving the brand. */
.brand {
  display: inline-flex;
  align-items: center;
  color: hsl(var(--foreground));
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.7;
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
  display: block;
}

.topbar-link {
  font-size: 0.9375rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.topbar-link:hover {
  color: hsl(var(--foreground));
}

/* ---- type ---- */

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  text-wrap: balance;
}

h2 {
  font-size: 1.5rem;
  margin-top: 4rem;
  padding-top: 2.25rem;
  border-top: 1px solid hsl(var(--border));
}

h3 {
  font-size: 1.0625rem;
  margin-top: 2.25rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
  color: hsl(var(--muted-foreground));
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

li::marker {
  color: hsl(var(--border));
}

a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.lede {
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  max-width: 44rem;
}

.note {
  font-size: 0.9375rem;
}

/* ---- meta strip under the title ---- */

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.5rem;
  margin: 2.5rem 0 3rem;
  padding: 0;
  list-style: none;
}

.meta div {
  min-width: 8rem;
  margin-bottom: 1rem;
}

.meta dt {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.meta dd {
  margin: 0.25rem 0 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ---- figures ---- */

figure {
  margin: 2.5rem 0 3rem;
}

/* The captures are 1512px wide. On a roomy screen a figure breaks out past
   the text column, so the interface inside it stays readable. */
@media (min-width: 62rem) {
  figure {
    width: min(66rem, calc(100vw - 4rem));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--surface));
}

figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ---- surface panel ---- */

.surface {
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  margin: 0 0 1.5rem;
}

.surface > :last-child {
  margin-bottom: 0;
}

.surface h3 {
  margin-top: 0;
}

/* ---- stack table ---- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
}

th {
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: hsl(var(--foreground));
  background: hsl(var(--surface));
  width: 12rem;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- actions ---- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.btn-primary {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.btn-primary:hover {
  background: hsl(var(--foreground) / 0.9);
}

.btn-secondary {
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-secondary:hover {
  background: hsl(var(--border) / 0.55);
}

.btn:focus-visible,
a:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 3px;
}

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

.pagefoot {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.pagefoot p {
  font-size: inherit;
}

@media (max-width: 34rem) {
  .topbar {
    margin-bottom: 2.75rem;
  }

  h2 {
    margin-top: 3rem;
  }

  .btn {
    width: 100%;
  }
}
