/*
 * @abhishekshankar/ds 0.1.0: components (requires tokens.css)
 * Generated by scripts/build.mjs. Do not edit: change tokens/tokens.json or src/ instead.
 */

/*
 * Reference implementations: plain CSS on top of tokens.css. Source: src/components.css; it is linted with
 * the package's own Stylelint config, so it must stay literal-free.
 * Import it from the package, or port each block to your framework's styling
 * (see docs/adapters.md). Class names use a `ds-` prefix to avoid
 * collisions; rename freely when porting, but keep the values and states.
 */

/* ---------- Text primitives ---------- */
.ds-display {
  font-size: var(--text-display-size);
  font-weight: var(--text-display-weight);
  letter-spacing: var(--text-display-tracking);
  line-height: var(--text-display-leading);
  text-wrap: balance;
}

.ds-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--text-subtitle-size);
  font-weight: var(--text-subtitle-weight);
  letter-spacing: var(--text-subtitle-tracking);
  line-height: var(--text-subtitle-leading);
  text-wrap: balance;
}

.ds-eyebrow {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  letter-spacing: var(--text-eyebrow-tracking);
  line-height: 1.3;
  text-transform: uppercase;
}

.ds-prose {
  max-width: var(--reading-column-width);
  color: var(--color-text-secondary);
  font-family: var(--font-serif);
  font-size: var(--text-prose-size);
  line-height: var(--text-prose-leading);
  text-wrap: pretty;
}
.ds-prose > * + * { margin-top: 18px; }

/* ---------- Links ---------- */
/* Links change color, never underline on hover (except inline prose links). */
.ds-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--motion-duration-fast) var(--motion-ease-standard);
}
.ds-link:hover { color: var(--color-text-primary); }

.ds-arrow {
  display: inline-block;
  margin-left: var(--space-2);
  color: var(--color-text-secondary);
  transition:
    transform var(--motion-duration-moderate) var(--motion-ease-enter),
    color var(--motion-duration-fast) var(--motion-ease-standard);
}
/* → nudges right; ↗ (external) nudges up-right. */
:hover > .ds-arrow, :focus-visible > .ds-arrow { color: var(--color-text-primary); transform: translateX(3px); }
:hover > .ds-arrow--external, :focus-visible > .ds-arrow--external { transform: translate(1px, -1px); }

/* ---------- Focus ---------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

/* ---------- Buttons (derived: the site has few buttons; these follow its rules) ---------- */
.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard);
}
.ds-button--primary { color: var(--color-text-on-inverse); background: var(--color-surface-inverse); }
.ds-button--primary:hover { background: color-mix(in srgb, var(--color-surface-inverse) 88%, var(--color-surface-0)); }
.ds-button--secondary { color: var(--color-text-primary); background: var(--color-surface-10); border-color: var(--color-border); }
.ds-button--secondary:hover { border-color: var(--color-border-strong); }
.ds-button--ghost { color: var(--color-text-secondary); background: transparent; }
.ds-button--ghost:hover { color: var(--color-text-primary); background: var(--color-fill-hover); }
.ds-button:disabled { opacity: 0.4; cursor: not-allowed; }

.ds-icon-button {
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--color-text-secondary);
  background: transparent;
  cursor: pointer;
  transition:
    color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard);
}
.ds-icon-button:hover { color: var(--color-text-primary); background: var(--color-fill-hover); }
.ds-icon-button svg { width: 20px; height: 20px; }

/* ---------- Pill / caption ---------- */
.ds-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-primary);
  background: var(--color-surface-10);
  font-size: var(--text-caption);
  white-space: nowrap;
}

/* ---------- Input group ---------- */
.ds-field {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-10);
  transition:
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}
.ds-field:focus-within {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-focus-halo);
}
.ds-field input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 0;
  outline: 0;
  color: var(--color-text-primary);
  background: transparent;
  font: inherit;
  font-size: var(--text-small);
}
.ds-field input::placeholder { color: var(--color-text-secondary); }
.ds-field button {
  display: grid;
  place-items: center;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: transparent;
  cursor: pointer;
}
.ds-field button:hover { color: var(--color-text-primary); background: var(--color-fill-hover); }
.ds-field-error { margin-top: var(--space-2); color: var(--color-text-danger); font-size: 12.5px; }

/* ---------- Tile (bento cell with hover caption) ---------- */
.ds-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-10);
  color: inherit;
  text-decoration: none;
}
.ds-tile--inverse { background: var(--color-surface-inverse); border-color: var(--color-border-inverse); }
a.ds-tile:focus-visible { outline-width: 3px; outline-offset: 3px; }

.ds-tile__caption {
  position: absolute;
  bottom: 14px;
  left: 50%;
  padding: var(--space-1) 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-primary);
  background: var(--color-surface-10);
  font-size: var(--text-caption);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(var(--motion-shift-small));
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-enter);
}
.ds-tile--inverse .ds-tile__caption {
  color: var(--color-caption-on-inverse);
  background: var(--color-caption-on-inverse-bg);
  border-color: var(--color-caption-on-inverse-border);
  box-shadow: var(--shadow-float-dark);
}
.ds-tile:hover > .ds-tile__caption,
.ds-tile:focus-within > .ds-tile__caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* No hover on touch: captions stay visible. */
@media (hover: none), (max-width: 768px) {
  .ds-tile > .ds-tile__caption { opacity: 1; transform: translateX(-50%); }
}

/* ---------- Card ---------- */
.ds-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 230px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-10);
}
.ds-card--compact { min-height: 190px; padding: clamp(22px, 2.5vw, 30px); }
.ds-card--inverse,
.ds-card--accent {
  color: var(--color-text-on-inverse);
  border-color: var(--color-border-inverse);
  background: var(--color-surface-inverse);
}
.ds-card--accent {
  background:
    radial-gradient(circle at 100% 115%, var(--color-accent-glow), transparent 42%),
    var(--color-surface-inverse);
}
.ds-card__meta { display: flex; align-items: center; gap: 10px; }
.ds-card--inverse .ds-eyebrow, .ds-card--accent .ds-eyebrow { color: var(--color-text-on-inverse-secondary); }
.ds-card__metric {
  margin-top: auto;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}
.ds-card__title {
  margin: auto 0 10px;
  font-size: clamp(18px, 2vw, 22.5px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: var(--text-heading-tracking);
}
.ds-card__metric + .ds-card__title { margin-top: var(--space-6); }
.ds-card__body {
  color: var(--color-text-secondary);
  font-family: var(--font-serif);
  font-size: var(--text-small);
  line-height: 1.55;
}
.ds-card--inverse .ds-card__body, .ds-card--accent .ds-card__body { color: var(--color-text-on-inverse-secondary); }

/* ---------- Callout ---------- */
.ds-callout {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) minmax(0, 1.35fr);
  align-items: start;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(24px, 3.5vw, 40px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-10);
}
.ds-callout--accent { border-color: var(--color-accent-border); background: var(--color-accent-subtle); }
.ds-callout--inverse { color: var(--color-text-on-inverse); border-color: var(--color-border-inverse); background: var(--color-surface-inverse); }
.ds-callout--inverse .ds-eyebrow { color: var(--color-accent); }
.ds-callout__title { margin-top: 10px; font-size: var(--text-h3-size); font-weight: 500; line-height: 1.3; letter-spacing: var(--text-heading-tracking); }
.ds-callout__body { color: var(--color-text-secondary); font-family: var(--font-serif); font-size: 15px; line-height: 1.62; }
.ds-callout--inverse .ds-callout__body { color: var(--color-text-on-inverse-secondary); }
@media (max-width: 700px) { .ds-callout { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- Section ---------- */
.ds-section {
  width: min(var(--container-inner), calc(100% - 2 * var(--container-padding)));
  margin-inline: auto;
  padding-block: var(--space-section);
}
.ds-section--divider { border-top: 1px solid var(--color-divider); }
.ds-section__header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: clamp(40px, 8vw, 120px);
}
.ds-section__header .ds-eyebrow { margin-bottom: 18px; }
.ds-section__title {
  max-width: 820px;
  font-size: var(--text-h2-size);
  font-weight: 400;
  line-height: var(--text-h2-leading);
  letter-spacing: var(--text-h2-tracking);
  text-wrap: balance;
}
.ds-section__lede { max-width: 500px; color: var(--color-text-secondary); font-family: var(--font-serif); font-size: 16.5px; line-height: 1.62; }
.ds-section__body { margin-top: clamp(40px, 5vw, 68px); }
@media (max-width: 820px) { .ds-section__header { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 600px) { .ds-section { padding-block: 72px; } }

/* ---------- Rows (index lists: projects, history, facts) ---------- */
.ds-rows { display: flex; flex-direction: column; border-top: 1px solid var(--color-border); }
.ds-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-6);
  min-height: 52px;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  color: inherit;
  text-decoration: none;
}
.ds-row__meta { color: var(--color-text-secondary); font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.ds-row__title { color: var(--color-text-primary); font-size: var(--text-body); }
.ds-row__aside { color: var(--color-text-secondary); font-size: var(--text-body); text-align: right; }
a.ds-row:focus-visible { outline-offset: 4px; }
@media (max-width: 768px) {
  .ds-row { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-4) 0; }
  .ds-row__meta { display: none; }
  .ds-row__aside { font-size: var(--text-small); }
}
@media (max-width: 560px) {
  .ds-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .ds-row__aside { text-align: left; }
}

/* Key/value facts (dl) */
.ds-facts { border-top: 1px solid var(--color-border); }
.ds-facts > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) 1.35fr;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13.5px;
  line-height: 1.45;
}
.ds-facts dt { color: var(--color-text-secondary); }

/* ---------- Floating sheet (bottom-anchored panel) ---------- */
.ds-sheet {
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 var(--container-padding) var(--space-8);
  pointer-events: none;
}
.ds-sheet__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-0);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
  animation: ds-sheet-in var(--motion-duration-page) var(--motion-ease-enter) both;
}
.ds-icon-well {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  background: var(--color-surface-10);
}
@keyframes ds-sheet-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 600px) { .ds-sheet { padding-bottom: var(--space-4); } .ds-sheet__panel { border-radius: var(--radius-lg); } }

/* ---------- Navbar ---------- */
.ds-navbar {
  position: relative;
  z-index: 101;
  display: flex;
  justify-content: center;
  height: var(--nav-height);
  padding: 0 var(--container-padding);
  background: var(--color-surface-0);
}
.ds-navbar__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: var(--center-column-width); }
.ds-navbar__logo { color: var(--color-text-primary); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.ds-navbar__logo span { color: var(--color-text-secondary); }
.ds-navbar__links { display: flex; gap: var(--space-10); }
.ds-navbar__links a { font-size: var(--text-body); }
.ds-navbar__links a[aria-current="page"] { color: var(--color-text-primary); }
.ds-navbar__toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; }
.ds-navbar__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: var(--radius-xs);
  background: var(--color-text-primary);
  transition:
    transform var(--motion-duration-moderate) var(--motion-ease-standard),
    opacity var(--motion-duration-moderate) var(--motion-ease-standard);
}
.ds-navbar__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ds-navbar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ds-navbar__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.ds-navbar__menu {
  position: fixed;
  inset: var(--nav-height) 0 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-10) var(--container-padding);
  background: var(--color-surface-0);
}
.ds-navbar__menu.is-open { display: flex; }
.ds-navbar__menu a { display: flex; align-items: center; min-height: var(--tap-target); color: var(--color-text-primary); font-size: 24px; letter-spacing: -0.02em; text-decoration: none; }
@media (max-width: 768px) {
  .ds-navbar__links { display: none; }
  .ds-navbar__toggle { display: flex; align-items: center; padding: 10px; }
}

/* ---------- Footer ---------- */
.ds-footer { border-top: 1px solid var(--color-divider); }
.ds-footer__inner { width: 100%; max-width: var(--container-inner); margin: 0 auto; padding: 81px var(--container-padding); }
.ds-footer__heading { margin-bottom: var(--space-2); font-size: var(--text-small); font-weight: 500; letter-spacing: 0.01em; }
.ds-footer__col { display: flex; flex-direction: column; gap: 14px; }
.ds-footer__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-inner);
  margin: 0 auto;
  padding: var(--space-5) var(--container-padding);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
}
@media (max-width: 768px) { .ds-footer__inner { padding-block: 48px; } .ds-footer__bar { flex-direction: column; align-items: flex-start; gap: var(--space-2); } }
