/* Black Dragon Lab
 * ────────────────────────────────────────────────────────────────────────
 * Static CSS, no build step, no webfonts, no JavaScript anywhere. The
 * content security policy served by CloudFront has no script-src at all,
 * so anything interactive here has to be CSS or it does not happen.
 *
 * Dark by commitment rather than preference: the mark is white on black
 * with no light-ground variant, and inverting a logo is how you make it
 * look like a mistake.
 */

:root {
  color-scheme: dark;

  /* Colour ------------------------------------------------------------ */
  --ink:     #04060a;   /* the page */
  --surface: #0a0e14;   /* cards, one step up from the page */
  --line:    #161d26;   /* hairline borders */
  --line-lit:#222c38;   /* borders that must be noticed */
  --text:    #f2f5f8;   /* off-white, never pure white */
  --muted:   #94a1af;   /* passes AA on --ink at every size used */
  --dim:     #64717f;

  /* Blue appears in exactly three places: the primary button, focus
     rings, and the glow behind the device. Never on body text. */
  --accent:      #3d8bff;
  --accent-soft: #6ba6ff;
  --glow:        rgba(61, 139, 255, 0.14);

  /* Type -------------------------------------------------------------- */
  --t-eyebrow: 11px;
  --t-sm:      13px;
  --t-body:    17px;
  --t-lede:    21px;

  /* Space, 8px base ---------------------------------------------------- */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --s6: 104px;
  --s7: 160px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: var(--t-body)/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

/* Prose keeps a readable measure even inside the wider shell. */
.prose { max-width: 40rem; }

/* The hero headline is set at up to 68px, which a 40rem measure breaks into
   four short lines. It gets its own wider bound; the sentence beneath keeps
   the readable one, so the two are not competing for the same width. */
.hero .prose { max-width: 54rem; }
.hero .lede { max-width: 34rem; }

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

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: 78px;
}

.brand { display: inline-flex; line-height: 0; text-decoration: none; }
.brand img { height: 34px; width: auto; }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: var(--s3);
  font-size: 15px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s ease;
}

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

/* ── Sections ───────────────────────────────────────────────────────── */

section { padding: var(--s6) 0; }
section + section { border-top: 1px solid var(--line); }

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

.eyebrow {
  font: 500 var(--t-eyebrow)/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 var(--s3);
}

h1 {
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
  margin: 0 0 var(--s3);
}

h2 {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
  margin: 0 0 var(--s2);
}

h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 var(--s1);
}

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

.lede {
  font-size: var(--t-lede);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
  margin-bottom: var(--s4);
}

a { color: var(--text); text-decoration-color: var(--line-lit); }
a:hover { text-decoration-color: currentColor; }

/* ── Buttons ────────────────────────────────────────────────────────── */

.actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-top: var(--s4);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 13px 22px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease,
              box-shadow 0.16s ease, transform 0.16s ease;
}

.btn-primary {
  background: var(--accent);
  color: #03101f;
  box-shadow: 0 8px 30px -12px var(--accent);
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: var(--line-lit);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--muted);
  background: var(--surface);
}

/* Not a button. A control that does nothing when tapped is a small lie,
   so this reads as the status it is. */
.status {
  font: var(--t-sm)/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ── Featured app ───────────────────────────────────────────────────── */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: var(--s7);
  align-items: center;
}

.feature .words { min-width: 0; }

/* Alternating sides, so a column of these does not march down one edge. */
.feature.flip { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }
.feature.flip .device-shell { order: -1; justify-self: start; }

.spec {
  list-style: none;
  padding: 0;
  margin: var(--s3) 0 0;
}

.spec li {
  position: relative;
  padding-left: var(--s3);
  margin-bottom: var(--s1);
  color: var(--muted);
}

/* A short rule rather than a bullet — same hairline language as the
   borders, and it does not read as a list of features to skim past. */
.spec li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 12px;
  height: 1px;
  background: var(--line-lit);
}

/* ── Device ─────────────────────────────────────────────────────────── */

.device-shell { position: relative; justify-self: end; width: 100%; }

/* One soft radial, sitting behind the phone. It is the only glow on the
   site and it does not move. */
.device-shell::before {
  content: "";
  position: absolute;
  inset: -18% -22%;
  background: radial-gradient(60% 50% at 50% 45%, var(--glow), transparent 70%);
  pointer-events: none;
}

.device {
  position: relative;
  border-radius: 44px;
  padding: 9px;
  background: linear-gradient(155deg, #333d49, #0d1218 45%, #232c37);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.95),
              0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Frame drawn in CSS rather than composited into the file, so the
   screenshot stays a plain screenshot and can be swapped without a
   design tool. */
.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 36px;
}

/* ── Principles ─────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  margin-top: var(--s4);
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s3);
  transition: border-color 0.16s ease;
}

.tile:hover { border-color: var(--line-lit); }

.tile svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: var(--s2);
  display: block;
}

.tile p { margin: 0; color: var(--muted); font-size: 16px; }

/* ── Project rows ───────────────────────────────────────────────────── */

.row {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.row:last-of-type { border-bottom: 1px solid var(--line); }
a.row:hover { border-color: var(--line-lit); }

.row img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
  background: #000;
  border: 1px solid var(--line);
}

.row .meta {
  font: var(--t-eyebrow)/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 var(--s1);
}

.row p:last-child { margin: 0; color: var(--muted); font-size: 16px; }

/* ── Long-form pages ────────────────────────────────────────────────── */

.doc h2 {
  font-size: 20px;
  letter-spacing: -0.012em;
  margin: var(--s5) 0 var(--s1);
}

.doc ul { padding-left: 20px; margin: 0 0 var(--s2); }
.doc li { margin-bottom: var(--s1); }

.updated {
  font: var(--t-sm)/1 var(--mono);
  color: var(--dim);
  margin: 0 0 var(--s4);
}

.note {
  border-left: 1px solid var(--line-lit);
  padding-left: var(--s3);
  margin: var(--s3) 0;
  color: var(--muted);
}

.note p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s4) 0 var(--s5);
  margin-top: var(--s6);
}

.site-footer .wrap {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  align-items: center;
  font-size: 15px;
  color: var(--dim);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .push { margin-left: auto; }

/* ── Motion ─────────────────────────────────────────────────────────── */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .feature, .cards, .row, .doc > h2 {
      animation: rise 400ms linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 28%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(20px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* ── Breakpoints ────────────────────────────────────────────────────── */

@media (max-width: 60rem) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: var(--s5); }
  .feature.flip .device-shell { order: 0; }
  .device-shell { justify-self: center; max-width: 20rem; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 34rem) {
  :root { --s6: 72px; --s7: 88px; }
  .site-header .wrap { gap: var(--s3); min-height: 66px; }
  .brand img { height: 26px; }
  .site-nav { gap: var(--s2); font-size: 14px; }
  .actions { gap: var(--s2); }
  .btn { width: 100%; justify-content: center; }
  .status { width: 100%; text-align: center; }
  .site-footer .push { margin-left: 0; }
}
