/* ============================================================
   TINS Studio — design system
   ============================================================ */

:root {
  /* Surface scale (dark, monochrome) */
  --bg: #07070a;
  --bg-1: #0c0c10;
  --bg-2: #131318;
  --bg-3: #1b1b22;
  --bg-4: #24242c;

  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
  --line-3: rgba(255, 255, 255, 0.16);

  /* Text */
  --fg: #f4f4f6;
  --fg-2: #c5c5cb;
  --fg-3: #8a8a92;
  --fg-4: #5a5a62;

  /* Accent (monochrome silver) */
  --accent: #e5e5e7;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(229, 229, 231, 0.12);

  /* Status palette */
  --status-new:        #8a8a92;
  --status-planned:    #c4b8ff;
  --status-progress:   #ffd58a;
  --status-shipped:    #8ee5b4;
  --status-bug:        #ff8a8a;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radius + spacing */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;
  --r-2xl: 28px;

  /* Shadows */
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 255, 255, 0.025), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 255, 255, 0.02), transparent 60%),
    var(--bg);
}

#root { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
  text-wrap: balance;
}

h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3vw, 44px); line-height: 1.1; letter-spacing: -0.025em; }
h3 { font-size: 22px; line-height: 1.25; }
h4 { font-size: 16px; line-height: 1.3; }

p { margin: 0; color: var(--fg-2); text-wrap: pretty; }

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

.mono { font-family: var(--font-mono); }
.kbd, .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

.page { flex: 1; padding: 56px 0 120px; }

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

.row { display: flex; gap: 16px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 7, 10, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.nav-brand .logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(180deg, #fafafa, #b5b5ba);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.04em;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 4px 14px rgba(255,255,255,0.08);
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--fg-3);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--fg); background: var(--bg-2); }
.nav-link.active { color: var(--fg); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-3);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--line-2); }

.btn-soft {
  background: var(--bg-2);
  color: var(--fg);
  border-color: var(--line);
}
.btn-soft:hover { background: var(--bg-3); }

.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Card / surface ---------- */

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.card.interactive:hover {
  border-color: var(--line-2);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
}

/* ---------- Badge / tag ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  background: var(--bg-2);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge[data-status="new"]      { color: var(--status-new); }
.badge[data-status="planned"]  { color: var(--status-planned); border-color: color-mix(in srgb, var(--status-planned) 30%, transparent); background: color-mix(in srgb, var(--status-planned) 8%, var(--bg-2)); }
.badge[data-status="progress"] { color: var(--status-progress); border-color: color-mix(in srgb, var(--status-progress) 30%, transparent); background: color-mix(in srgb, var(--status-progress) 8%, var(--bg-2)); }
.badge[data-status="shipped"]  { color: var(--status-shipped); border-color: color-mix(in srgb, var(--status-shipped) 30%, transparent); background: color-mix(in srgb, var(--status-shipped) 8%, var(--bg-2)); }
.badge[data-status="bug"]      { color: var(--status-bug); border-color: color-mix(in srgb, var(--status-bug) 30%, transparent); background: color-mix(in srgb, var(--status-bug) 8%, var(--bg-2)); }

/* ---------- Inputs ---------- */

input, textarea, select {
  width: 100%;
  background: var(--bg-1);
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--line-3);
  background: var(--bg-2);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

label { font-size: 13px; color: var(--fg-3); font-weight: 500; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  margin-top: auto;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.015));
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}
.footer a { display: block; padding: 4px 0; color: var(--fg-2); font-size: 14px; }
.footer a:hover { color: var(--fg); }
.footer-bot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--fg-3);
  font-size: 13px;
}

/* ---------- Decorative ---------- */

.placeholder-art {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.04) 0,
    rgba(255,255,255,0.04) 1px,
    transparent 1px,
    transparent 9px
  );
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--fg-3);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-3), transparent);
}

.scroll-hint {
  width: 24px; height: 36px;
  border: 1px solid var(--line-3);
  border-radius: 12px;
  position: relative;
}
.scroll-hint::after {
  content: '';
  position: absolute;
  left: 50%; top: 8px;
  width: 2px; height: 6px;
  background: var(--fg-3);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollHint 1.6s ease-in-out infinite;
}
@keyframes scrollHint {
  0%, 100% { opacity: 0.4; transform: translate(-50%, 0); }
  50%      { opacity: 1;   transform: translate(-50%, 10px); }
}

/* ---------- Vote pill ---------- */

.vote {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-1);
}
.vote button {
  width: 44px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.vote button:hover { background: var(--bg-3); color: var(--fg); }
.vote button.on.up { color: var(--status-shipped); background: color-mix(in srgb, var(--status-shipped) 10%, transparent); }
.vote button.on.down { color: var(--status-bug); background: color-mix(in srgb, var(--status-bug) 10%, transparent); }
.vote .count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  padding: 4px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 44px;
  text-align: center;
}

/* horizontal variant used in cards */
.vote.h {
  flex-direction: row;
  border-radius: 999px;
}
.vote.h .count { border-top: none; border-bottom: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0 12px; height: 30px; display: grid; place-items: center; }
.vote.h button { width: 36px; height: 30px; }

/* ---------- Modal ---------- */

.modal-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: scrimIn 0.2s ease;
}
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal h3 { margin-bottom: 4px; }
.modal .field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  box-shadow: var(--shadow-soft);
  animation: toastIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Utilities ---------- */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-link { padding: 8px 8px; }
  h1 { font-size: 44px; }
}

.muted { color: var(--fg-3); }
.dim   { color: var(--fg-4); }
.center { text-align: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 32px; }

.eyebrow-line {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.eyebrow-line::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--line-3);
}

/* App icon placeholder tiles */
.app-tile {
  aspect-ratio: 1;
  border-radius: 22%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.04em;
  color: var(--fg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.app-tile::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(255,255,255,0.18), transparent 50%),
    radial-gradient(80% 60% at 100% 100%, rgba(0,0,0,0.3), transparent 60%);
  pointer-events: none;
}

/* Requests page helpers */
.type-tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 28px;
}
.type-tab {
  background: transparent;
  color: var(--fg-3);
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.15s ease;
}
.type-tab.active { background: var(--bg-3); color: var(--fg); border-color: var(--line-2); }

.sort-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-3);
}
.sort-btn.active { background: var(--bg-3); border-color: var(--line-2); color: var(--fg); }

/* Custom page grids collapse gracefully on narrow viewports */
@media (max-width: 880px) {
  .app-card-grid { grid-template-columns: 1fr !important; }
  .app-card-grid > div:last-child { border-left: none !important; border-top: 1px solid var(--line); align-items: stretch !important; }
  .about-split,
  .contact-split { grid-template-columns: 1fr !important; gap: 32px !important; }
}
