/* ── Fonts ───────────────────────────────────────────── */

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/brand/fonts/hanken-grotesk-v12-cyrillic-ext_latin_latin-ext_vietnamese-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/brand/fonts/hanken-grotesk-v12-cyrillic-ext_latin_latin-ext_vietnamese-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/brand/fonts/hanken-grotesk-v12-cyrillic-ext_latin_latin-ext_vietnamese-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/brand/fonts/hanken-grotesk-v12-cyrillic-ext_latin_latin-ext_vietnamese-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('/brand/fonts/instrument-serif-v5-latin_latin-ext-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('/brand/fonts/instrument-serif-v5-latin_latin-ext-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/brand/fonts/jetbrains-mono-v24-cyrillic_cyrillic-ext_greek_latin_latin-ext_vietnamese-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/brand/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Noto Serif disponible en /brand/fonts/ para scripts futuros (cirílico, griego, etc.)
   Añadir @font-face con unicode-range cuando se active el idioma correspondiente. */


/* ── Tokens ──────────────────────────────────────────── */

:root, [data-theme="parent"] {
  --bg:        #ECEAE2;
  --surface:   #F6F4EE;
  --border:    #DBD6CB;
  --text:      #1A211C;
  --text-2:    #7C837B;
  --text-soft: #474E47;
  --accent:    #6E9A80;
  --on-accent: #18211B;

  --font:         'Hanken Grotesk', system-ui, sans-serif;
  --font-display: 'Instrument Serif', serif;
  --font-mono:    'JetBrains Mono', monospace;
}

[data-theme="child"] {
  --bg:        #0C1310;
  --surface:   #101A15;
  --border:    #243029;
  --text:      #ECEFEA;
  --text-2:    #7C8A82;
  --text-soft: #C2CCC4;
  --accent:    #9DBCA5;
  --on-accent: #0C1310;
}


/* ── Reset ───────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4 {
  overflow-wrap: break-word;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

ul, ol {
  list-style: none;
}


/* ── App header ──────────────────────────────────────── */

.app-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  max-width: 960px;
  margin: 0 auto;
}

.header-logo img {
  height: 28px;
  display: block;
}

.header-nav {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 120ms ease;
}

.header-profile svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.header-profile-label { display: none; }

.header-profile.is-active,
.header-profile:hover  { color: var(--accent); }

.header-nav-item {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color 120ms ease;
}

.header-nav-item.is-active,
.header-nav-item:hover { color: var(--text); }

.header-nav-item.is-active {
  border-bottom: 2px solid var(--accent);
}

@media (min-width: 768px) {
  .app-header-inner  { padding: 14px 32px; }
  .header-logo img   { height: 32px; }

  .header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    padding-left: 32px;
  }

  .header-profile-label { display: inline; }

  .bottom-nav    { display: none !important; }
  .has-bottom-nav { padding-bottom: 0 !important; }
}


/* ── Footer ──────────────────────────────────────────── */

.app-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 16px;
  max-width: 960px;
  margin: 0 auto;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-2);
}

.footer-nav {
  display: flex;
  gap: 16px;
}

.footer-nav a {
  font-size: 0.75rem;
  color: var(--text-2);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-nav a:hover { color: var(--text); }

@media (min-width: 768px) {
  .app-footer-inner { padding: 20px 32px; }
}


/* ── Bottom navigation ───────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 12px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 120ms ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active {
  color: var(--accent);
}

.has-bottom-nav {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}


/* ── Typography ──────────────────────────────────────── */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.mono {
  font-family: var(--font-mono);
}
