/* Tarahbi Apps studio design system.
   Deliberately its own identity: cool ink + indigo, Space Grotesk display,
   IBM Plex Sans body. This is the STUDIO look and is intentionally distinct
   from any single app's theme (Tuck and Tahqiq each own their page's design).
   Tokens drive everything; light and dark are defined at the token level. */

:root {
  /* Raw studio palette: cool, near-monochrome ink with one indigo accent. */
  --ink-900: #101116;
  --ink-800: #16181D;
  --ink-700: #22262E;
  --paper: #F6F6F9;
  --paper-2: #EEEEF3;
  --white: #FFFFFF;
  --indigo: #4B44E0;
  --indigo-deep: #3A34C0;
  --indigo-soft: #ECEBFB;
  --indigo-bright: #9591FF;
  --slate: #565B67;
  --line: #E4E4EC;

  /* Semantic tokens, light mode defaults. */
  --bg: var(--paper);
  --surface: var(--white);
  --surface-2: var(--paper-2);
  --text: var(--ink-800);
  --text-muted: var(--slate);
  --accent: var(--indigo);
  --accent-hover: var(--indigo-deep);
  --accent-soft: var(--indigo-soft);
  --on-accent: #FFFFFF;
  --border: var(--line);
  --hero-bg: var(--ink-900);
  --hero-text: #F4F4F8;
  --hero-muted: #A9AEBC;
  --footer-bg: var(--ink-900);
  --shadow: 0 1px 2px rgba(16, 17, 22, .05), 0 10px 30px rgba(16, 17, 22, .07);
  --shadow-lift: 0 2px 4px rgba(16, 17, 22, .06), 0 18px 44px rgba(16, 17, 22, .12);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;

  --maxw: 70rem;
  --maxw-read: 62ch;
  --radius: 18px;
  --radius-sm: 11px;
  --radius-lg: 26px;
  --space: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0D11;
    --surface: #15171D;
    --surface-2: #1B1E25;
    --text: #ECEDF2;
    --text-muted: #A0A5B2;
    --accent: var(--indigo-bright);
    --accent-hover: #B4B1FF;
    --accent-soft: #211F3A;
    --on-accent: #0C0D11;
    --border: #282C35;
    --hero-bg: #08090C;
    --hero-text: #F1F2F6;
    --hero-muted: #9096A4;
    --footer-bg: #08090C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .5);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 22px 50px rgba(0, 0, 0, .6);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.0; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1rem; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: .78rem;
  color: var(--accent);
  margin: 0 0 1rem;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space); }

.skip-link {
  position: absolute; left: 0; top: -3.5rem;
  background: var(--accent); color: var(--on-accent);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100; transition: top .15s ease; font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ---- Navigation ---- */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem;
  letter-spacing: -0.02em; color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: .6rem;
}
.brand svg, .brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: .45rem .85rem; border-radius: 999px;
  color: var(--text-muted); text-decoration: none;
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--on-accent); background: var(--accent); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  padding: .8rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-muted); }

/* ---- Sections ---- */
section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 6vw, 4rem); }
.lead { font-size: clamp(1.15rem, 2.4vw, 1.4rem); color: var(--text-muted); max-width: 52ch; line-height: 1.55; }

/* ---- Hero ---- */
.hero {
  background: var(--hero-bg); color: var(--hero-text);
  padding-block: clamp(4.5rem, 13vw, 9rem);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(48rem 30rem at 82% -8%, color-mix(in srgb, var(--indigo) 42%, transparent), transparent 60%),
    radial-gradient(34rem 24rem at -6% 108%, color-mix(in srgb, var(--indigo) 24%, transparent), transparent 62%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--indigo-bright); }
.hero h1 { color: var(--hero-text); max-width: 16ch; }
.hero .lead { color: var(--hero-muted); max-width: 54ch; margin-top: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.25rem; }
.hero .btn-ghost { color: var(--hero-text); border-color: color-mix(in srgb, var(--hero-text) 35%, transparent); }
.hero .btn-ghost:hover { background: color-mix(in srgb, var(--hero-text) 12%, transparent); color: var(--hero-text); border-color: color-mix(in srgb, var(--hero-text) 55%, transparent); }

/* ---- Studio manifesto ---- */
.manifesto { display: grid; gap: 2rem; }
.manifesto .lead { max-width: 60ch; font-size: clamp(1.25rem, 2.6vw, 1.6rem); color: var(--text); line-height: 1.5; }
.manifesto .lead strong { color: var(--text); font-weight: 600; }

/* Values row */
.values {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 1rem;
  list-style: none; padding: 0;
}
.value {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow);
}
.value h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.value p { margin: 0; color: var(--text-muted); font-size: .98rem; }
.value .value-mark {
  width: 2.4rem; height: 2.4rem; border-radius: 12px; margin-bottom: 1rem;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.value .value-mark svg { width: 1.4rem; height: 1.4rem; }

/* ---- Apps section ---- */
.apps-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2.5rem; }
.app-card {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow); transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.app-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.app-card-head { display: flex; align-items: center; gap: 1rem; }
.app-card-head img { width: 60px; height: 60px; border-radius: 15px; box-shadow: var(--shadow); }
.app-card h3 { font-size: 1.5rem; margin: 0; }
.app-card .app-kicker { font-family: var(--font-display); font-size: .82rem; letter-spacing: .04em; color: var(--text-muted); margin: 0; }
.app-card .app-desc { color: var(--text-muted); margin: 0; max-width: 48ch; }
.app-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: .25rem; }

.status-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-display); font-weight: 500; font-size: .8rem;
  padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface-2);
}
.status-chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.status-chip.is-soon { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.status-chip.is-dev { color: #8A5A0E; border-color: #d9b876; background: color-mix(in srgb, #d9b876 22%, transparent); }
@media (prefers-color-scheme: dark) {
  .status-chip.is-dev { color: #e0a845; border-color: #6a5526; background: color-mix(in srgb, #e0a845 14%, transparent); }
}

.btn-sm { padding: .55rem 1.1rem; font-size: .92rem; }
.btn-store[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; pointer-events: none;
  background: var(--surface-2); color: var(--text-muted); border-color: var(--border);
}

/* ---- Upcoming-app tile ---- */
/* Placeholder second card in the apps grid, keeping the row balanced until the
   next app launches (replace with a real .app-card then). */
.app-card.is-upcoming {
  align-content: center; text-align: center;
  border-style: dashed; background: var(--surface-2); box-shadow: none;
}
.app-card.is-upcoming:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.app-card.is-upcoming h3 { color: var(--text); }
.app-card.is-upcoming .app-desc { margin-inline: auto; }

/* ---- Footer ---- */
.site-footer {
  background: var(--footer-bg); color: #E9EAF0;
  padding-block: clamp(2.75rem, 6vw, 4.5rem); margin-top: 2rem;
}
.site-footer .container { display: grid; gap: 1rem; }
.site-footer p { color: #A7ACBA; max-width: 62ch; }
.site-footer a { color: #E9EAF0; font-weight: 500; }
.foot-brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  color: #FFFFFF; margin: 0 0 .25rem; display: inline-flex; align-items: center; gap: .55rem;
}
.foot-brand svg { width: 26px; height: 26px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: .5rem 0; }
.foot-links a { color: #A7ACBA; text-decoration: none; font-family: var(--font-display); font-size: .95rem; }
.foot-links a:hover { color: #FFFFFF; }

/* ---- 404 ---- */
.notfound { text-align: center; padding-block: clamp(4.5rem, 13vw, 9rem); }
.notfound h1 { font-size: clamp(3.5rem, 12vw, 6rem); color: var(--text); }

/* ---- Wide-screen layout ---- */
@media (min-width: 46rem) {
  .values { grid-template-columns: repeat(3, 1fr); }
  /* Two apps sit side by side as balanced vertical tiles rather than one sparse
     full-width row with a small icon. */
  .apps-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .btn:hover, .app-card:hover { transform: none; }
}
