/* Egres landing page. Colours are the tokens in src/styles/tokens.css (dark
   and light); type is JetBrains Mono for the chrome and Inter for prose, as
   in design/SPEC.md. The repeated section pieces of design/Main.dc.html are
   classes here; the one-off diagrams keep their inline styles in
   src/pages/index.astro. */

body {
  margin: 0;
  background: var(--eg-bg);
  color: var(--eg-text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--eg-text); text-decoration: none; }
a:hover { color: var(--eg-accent); }
.eg-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.eg-sans { font-family: 'Inter', system-ui, sans-serif; }
.eg-page { min-height: 100vh; display: flex; flex-direction: column; }
.eg-wrap { max-width: 1240px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* ------------------------------------------------------------ lockup */
.eg-lockup { display: flex; align-items: center; gap: 10px; color: var(--eg-text); }
.eg-lockup:hover { color: var(--eg-text); }
.eg-bars { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.eg-bars span { display: block; height: 3px; border-radius: 1px; }
.eg-bars span:nth-child(1) { width: 8px; background: var(--eg-coral); }
.eg-bars span:nth-child(2) { width: 14px; background: var(--eg-green); }
.eg-bars span:nth-child(3) { width: 20px; background: var(--eg-accent); }
.eg-wordmark { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }

/* --------------------------------------------------------------- nav */
.eg-header { border-bottom: 1px solid var(--eg-line); }
.eg-nav { padding: 18px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.eg-nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.eg-nav-links a { font-size: 13.5px; color: var(--eg-text-3); }
.eg-nav-links a:hover { color: var(--eg-text); }

/* the round sun / moon toggle; the icon shown is the theme you would switch to */
.eg-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 999px;
  border: 1px solid var(--eg-border-strong); background: transparent;
  color: var(--eg-text-4); cursor: pointer; flex: none;
}
.eg-theme:hover { color: var(--eg-text); border-color: var(--eg-border-hover-2); }
.eg-theme svg { width: 15px; height: 15px; display: block; }
.eg-theme .eg-moon { display: none; }
:root[data-theme='light'] .eg-theme .eg-sun { display: none; }
:root[data-theme='light'] .eg-theme .eg-moon { display: block; }

/* -------------------------------------------------------------- hero */
.eg-dots { background-image: radial-gradient(var(--eg-dots) 1px, transparent 1px); background-size: 28px 28px; }
.eg-hero { padding: 36px 32px 48px; display: flex; align-items: center; }
.eg-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); gap: 64px; align-items: center; }
.eg-hero-lines { display: flex; flex-direction: column; justify-content: center; gap: 18px; min-height: 220px; }
.eg-hero-small { margin: 0; font-weight: 400; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.4; color: var(--eg-text-4); opacity: 0; transform: translateY(12px); transition: opacity 1.2s ease, transform .6s ease; }
.eg-hero-h1 { margin: 0; font-weight: 500; font-size: clamp(30px, 3vw, 44px); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.eg-hero-h1 em { font-style: normal; color: var(--eg-accent); }
.eg-hero-right { position: relative; min-height: 400px; display: flex; flex-direction: column; justify-content: center; gap: 16px; margin-top: 40px; padding-top: 30px; }
.eg-hero-frame { position: absolute; inset: -18px; border: 1px solid var(--eg-border); border-radius: 18px; background: var(--eg-frame-bg); opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform .8s cubic-bezier(.2,.8,.2,1), border-color .6s ease, background .6s ease; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); }
:root[data-theme='light'] .eg-hero-frame { box-shadow: 0 24px 70px rgba(15, 16, 22, 0.12); }
.eg-hero-label { position: absolute; top: -48px; left: 6px; padding: 0 14px; background: var(--eg-bg); display: inline-flex; opacity: 0; transform: translateY(8px); transition: opacity .5s ease .3s, transform .5s ease .3s; }
.eg-hero-label span { font-weight: 600; font-size: 60px; line-height: 1; letter-spacing: -0.035em; color: var(--eg-text); }
.eg-hero-tag { position: absolute; top: -26px; right: 6px; padding: 0 10px; background: var(--eg-bg); font-size: 11px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--eg-accent); opacity: 0; transform: translateY(8px); transition: opacity .5s ease .3s, transform .5s ease .3s; }
.eg-tiles { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.eg-tile {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px;
  background: var(--eg-raised); border: 1px solid var(--eg-border); border-radius: 10px;
  padding: 16px 14px; box-sizing: border-box; color: var(--eg-text);
  opacity: 0; transform: translate(0px, 18px) scale(.96);
  transition: opacity .55s ease, transform .65s cubic-bezier(.4,0,.2,1), border-color .4s ease;
}
.eg-tile:hover { border-color: var(--eg-border-hover) !important; color: var(--eg-text); }
.eg-tile-art { height: 52px; display: flex; align-items: center; justify-content: center; }
.eg-tile-name { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; color: var(--eg-text); text-align: center; }
.eg-tile-sub { display: block; height: 34px; font-size: 11px; line-height: 1.5; color: var(--eg-text-4); text-align: center; }
.eg-struck { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; font-size: 13px; line-height: 1.5; color: var(--eg-text-4); opacity: 0; transition: opacity .5s ease .3s; }
.eg-struck span { text-decoration: line-through; text-decoration-color: var(--eg-text-5); text-decoration-thickness: 1.5px; }
@media (max-width: 480px) { .eg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------- pitch */
.eg-pitch { border-top: 1px solid var(--eg-line); padding: 36px 32px; }
.eg-pitch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.eg-pitch-text { flex: 1 1 480px; max-width: 680px; display: flex; flex-direction: column; gap: 10px; }
.eg-tagline { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; color: var(--eg-text); text-wrap: balance; }
.eg-pitch-p { margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: 15px; line-height: 1.7; color: var(--eg-text-3); text-wrap: pretty; }
.eg-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; flex: 0 1 auto; min-width: 0; }
.eg-btn-primary { background: var(--eg-accent); color: var(--eg-on-accent); font-weight: 600; font-size: 14px; padding: 13px 20px; border-radius: 6px; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; }
.eg-btn-primary:hover { background: var(--eg-accent-hover); color: var(--eg-on-accent); }
.eg-btn-ghost { border: 1px solid var(--eg-border-strong); color: var(--eg-text-2); font-weight: 500; font-size: 14px; padding: 12px 20px; border-radius: 6px; min-height: 46px; display: inline-flex; align-items: center; box-sizing: border-box; }
.eg-btn-ghost:hover { border-color: var(--eg-border-hover-2); color: var(--eg-text); }

/* ---------------------------------------------------------- sections */
.eg-section { border-top: 1px solid var(--eg-line); padding: 96px 32px; }
.eg-deep { background: var(--eg-bg-deep); }
.eg-stack { display: flex; flex-direction: column; gap: 40px; }
.eg-stack-wide { gap: 56px; }
/* feature intro: eyebrow + h2 left, paragraphs + "read more" right */
.eg-intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px 64px; align-items: start; }
.eg-intro-head { display: flex; flex-direction: column; gap: 18px; }
.eg-intro-body { display: flex; flex-direction: column; gap: 14px; }
.eg-eyebrow { margin: 0; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--eg-accent); }
.eg-h2 { margin: 0; font-weight: 500; font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.eg-body { margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: 14.5px; line-height: 1.7; color: var(--eg-text-3); text-wrap: pretty; }
.eg-body code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px; color: var(--eg-text); }
.eg-more { font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.eg-fine { margin: 0; font-size: 12px; color: var(--eg-text-5); }
.eg-fine a { color: var(--eg-accent); }
/* the blog's animated figures, full width, no caption (the prose does that job) */
.eg-fig { margin: 0; width: 100%; }
.eg-fig img { display: block; width: 100%; height: auto; border-radius: 12px; }
/* two columns: text beside a diagram (storage), text beside the terminal (quickstart) */
.eg-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 64px; align-items: center; }
.eg-two-col-narrow { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.eg-text-col { display: flex; flex-direction: column; gap: 18px; }
.eg-text-col .eg-body { max-width: 520px; }
.eg-text-col-tight { gap: 16px; }
.eg-text-col-tight .eg-body { max-width: 500px; }

/* cards: the comparison strip, the measured tiles, the operations grid */
.eg-cards { display: grid; gap: 16px; }
.eg-cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; }
.eg-cards-4 { grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.eg-cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.eg-card { border: 1px solid var(--eg-border); border-radius: 10px; padding: 22px 22px 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; }
.eg-card-pad { padding: 24px; gap: 14px; }
.eg-card-accent { border-color: var(--eg-accent); }
.eg-card-label { margin: 0; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--eg-text-5); }
.eg-card-label-accent { color: var(--eg-accent); }
.eg-card-p { margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: 13.5px; line-height: 1.65; color: var(--eg-text-4); }
.eg-card-accent .eg-card-p { color: var(--eg-text-3); }
.eg-stat { margin: 0; font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; color: var(--eg-accent); }
.eg-stat-what { margin: 4px 0 0; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.4; color: var(--eg-text); }
.eg-stat-how { margin: 0; font-size: 11px; color: var(--eg-text-5); }
.eg-struck-term { margin: 0; font-size: 16px; line-height: 1.3; color: var(--eg-text); text-decoration: line-through; text-decoration-color: var(--eg-coral); text-decoration-thickness: 1.5px; }
.eg-struck-sub { margin: 0; font-size: 11px; color: var(--eg-text-5); }
.eg-struck-why { margin: 2px 0 0; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.65; color: var(--eg-text-3); }

/* the storage tab panel */
.eg-panel { background: var(--eg-bg-deep); border: 1px solid var(--eg-border); border-radius: 12px; padding: 24px 28px 28px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; }
.eg-deep .eg-panel { background: var(--eg-bg); }
.eg-seg { appearance: none; background: transparent; border: 0; border-radius: 6px; min-height: 36px; padding: 0 14px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; font-weight: 500; color: var(--eg-text-4); cursor: pointer; transition: background .15s, color .15s; }
.eg-seg:hover { color: var(--eg-text); }
.eg-seg-on { background: var(--eg-seg-on); color: var(--eg-text); box-shadow: inset 0 0 0 1px var(--eg-border-strong); }
.eg-node { background: var(--eg-raised-2); border: 1px solid var(--eg-border-hover); border-radius: 8px; padding: 14px 16px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.eg-node-name { font-size: 15px; font-weight: 500; }
.eg-node-sub { font-size: 11px; color: var(--eg-text-4); }
.eg-store { background: var(--eg-raised); border: 1px solid var(--eg-accent); border-radius: 8px; padding: 14px 16px; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; }
.eg-store-label { font-size: 11px; color: var(--eg-accent); }
.eg-files { display: flex; gap: 4px; flex-wrap: wrap; }
.eg-files span { display: block; width: 22px; height: 14px; border-radius: 2px; background: color-mix(in srgb, var(--eg-accent) 50%, transparent); }
.eg-wire { display: block; width: 2px; height: 26px; background: var(--eg-border-hover); margin: 0 auto; }

/* architecture table */
.eg-dl { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--eg-border); }
.eg-dl > div { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--eg-border); }
.eg-dl dt { margin: 0; font-size: 14px; color: var(--eg-accent); }
.eg-dl dd { margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.6; color: var(--eg-text-2); }
@media (max-width: 480px) { .eg-dl > div { grid-template-columns: 1fr; gap: 6px; } }

/* terminal blocks */
.eg-term { margin: 0; background: var(--eg-raised); border: 1px solid var(--eg-border); border-radius: 10px; padding: 28px; overflow-x: auto; font-size: 13.5px; line-height: 1.75; color: var(--eg-text-2); }
.eg-term-sm { font-size: 13px; line-height: 1.5; border-radius: 6px; padding: 12px 14px; white-space: pre-wrap; } /* the s3 line carries its own line break after the semicolon */
/* Content that swaps with a tab (the storage command, diagram and caption):
   every variant sits in the same grid cell, so the box is as tall as the
   tallest variant at any width and switching tabs never moves the page. */
.eg-swap { display: grid; }
.eg-swap > [data-mode] { grid-area: 1 / 1; min-width: 0; }
.eg-swap > [data-mode]:not([data-on]) { visibility: hidden; }
.eg-dim-text { color: var(--eg-text-5); }
.eg-bright { color: var(--eg-text); }
.eg-prompt { color: var(--eg-accent); }

/* ------------------------------------------------------------ footer */
.eg-foot { border-top: 1px solid var(--eg-line); padding: 48px 32px 56px; }
.eg-foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; align-items: flex-start; }
.eg-foot-brand { display: flex; flex-direction: column; gap: 10px; }
.eg-foot-brand p { margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; color: var(--eg-text-5); }
.eg-foot-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 32px; }
.eg-foot-nav > div { display: flex; flex-direction: column; gap: 10px; }
.eg-foot-nav p { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--eg-text-5); }
.eg-foot a { color: var(--eg-text-4); font-size: 14px; }
.eg-foot a:hover { color: var(--eg-text); }
.eg-trademark { margin: 40px 0 0; font-family: 'Inter', system-ui, sans-serif; font-size: 12px; line-height: 1.6; color: var(--eg-text-5); }

/* phones: tighten the gutters and the type */
@media (max-width: 720px) {
  .eg-nav, .eg-hero, .eg-pitch, .eg-section, .eg-foot { padding-left: 20px !important; padding-right: 20px !important; }
  .eg-section { padding-top: 64px; padding-bottom: 64px; }
  .eg-h2 { font-size: 30px; }
  .eg-hero-label span { font-size: 44px; }
  .eg-hero-right { margin-top: 56px; }
}
