@font-face {
  font-family: 'Inter Variable';
  src: url('/assets/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* Neutral tokens from OBJECKS UI src/styles.css. */
:root {
  font-family: 'Inter Variable', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --bg: #f4f4f4;
  --surface: #fff;
  --secondary: #e8e8e8;
  --ink: #111;
  --muted: #626262;
  --line: #c8c8c8;
  --hair: #dedede;
  --accent: #777777;
  --gutter: clamp(1.25rem, 5.25vw, 6.5rem);
  color: var(--ink);
  background: var(--bg);
  color-scheme: light;
  font-synthesis: none;
  font-kerning: normal;
}

:root[data-theme='dark'] {
  --bg: #0a0a0a;
  --surface: #141414;
  --secondary: #1c1c1c;
  --ink: #f5f5f5;
  --muted: #a4a4a4;
  --line: #424242;
  --hair: #313131;
  color-scheme: dark;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.frame {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.masthead, .status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.masthead {
  min-height: calc(4.25rem + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
}

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

.appearance {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.appearance span, .appearance svg, .tool-arrow { display: block; }

[hidden],
.show-in-dark,
[data-theme='dark'] .show-in-light {
  display: none !important;
}

[data-theme='dark'] .show-in-dark { display: block !important; }

.content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4.5dvh, 4rem);
  padding-top: clamp(2rem, 7.2dvh, 6.5rem);
  padding-bottom: clamp(1.25rem, 4.3dvh, 3.5rem);
}

h1 {
  margin: 0;
  font-size: clamp(2.125rem, min(9.2vw, 17dvh), 10rem);
  font-weight: 850;
  letter-spacing: -.047em;
  line-height: .9;
}

.directory {
  align-self: flex-end;
  width: min(100%, clamp(24rem, 43vw, 42rem));
  margin-top: auto;
}

.directory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 .7rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 500 .625rem/1.4 var(--mono);
  letter-spacing: .07em;
}

.directory-heading h2 { margin: 0; font: inherit; }

.tools {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  min-height: max(44px, clamp(2.75rem, 6dvh, 3.625rem));
  padding: .5rem 0;
  border-bottom: 1px solid var(--hair);
}

.tool-index { color: var(--muted); font: 500 .625rem/1.4 var(--mono); }
.tool-name { font-size: clamp(1.0625rem, 1.6vw, 1.375rem); font-weight: 590; line-height: 1.2; }
.tool:focus-visible { outline-offset: -2px; }

@media (hover: hover) {
  .appearance:hover, .tool:hover { background: var(--secondary); }
  .status a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

.appearance:active, .tool:active { background: var(--hair); }

.status {
  min-height: calc(2.125rem + env(safe-area-inset-bottom));
  gap: .75rem;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  font: 500 .5625rem/1.4 var(--mono);
  letter-spacing: .055em;
}

.status a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
}

.status span { color: var(--muted); }

@media (max-width: 850px) {
  .directory { width: 100%; }
}

@media (max-width: 705px) {
  .masthead { min-height: calc(3.375rem + env(safe-area-inset-top)); }
  .brand img { width: 7rem; }
  .status { min-height: calc(1.9375rem + env(safe-area-inset-bottom)); }
  .content {
    padding-top: clamp(1.75rem, 7.5dvh, 4.5rem);
    padding-bottom: clamp(1.125rem, 3.8dvh, 2.5rem);
  }
  h1 { font-size: clamp(2.125rem, 12.4vw, 5.375rem); }
  .tool { grid-template-columns: 2.5rem minmax(0, 1fr) auto; }
}

@media (max-height: 730px) {
  .content {
    gap: clamp(1.25rem, 3.1dvh, 1.75rem);
    padding-top: 2rem;
    padding-bottom: 1.25rem;
  }
}

@media (max-height: 680px) {
  .content { padding-top: 1.5rem; padding-bottom: 1rem; }
  .tool { min-height: max(44px, 2.75rem); }
}
