/* ============================================
   Sebast.tools — shared visual system
   sebast.css v1.2
   Import this file in every app.
   App-specific styles go in a separate <style>
   block after this link tag — never edit this file
   per-app.
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Instrument+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Roboto:ital,wght@0,300;0,400;0,500;1,300&family=DM+Mono:wght@400;500&display=swap');

/* --- Colour tokens --- */
:root {
  --bg:               #f0ede8;
  --bg-card:          #faf8f3;
  --text-primary:     #1a1917;
  --text-secondary:   #6b6860;
  --text-tertiary:    #a09d97;
  --border:           rgba(26,25,23,0.09);
  --border-hover:     rgba(26,25,23,0.18);
}

[data-theme="dark"] {
  --bg:               #141412;
  --bg-card:          #1e1d1b;
  --text-primary:     #f0ede8;
  --text-secondary:   #918e88;
  --text-tertiary:    #5a5752;
  --border:           rgba(240,237,232,0.07);
  --border-hover:     rgba(240,237,232,0.15);
}

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

/* --- Base --- */
body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* --- Grain texture --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23grain)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  mix-blend-mode: multiply;
  opacity: 0.07;
}

[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  opacity: 0.04;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 2.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo span {
  color: var(--text-tertiary);
}

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

/* --- Theme toggle --- */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.theme-toggle svg { width: 15px; height: 15px; }

/* --- Layout --- */
.page-section {
  padding: 0 2.5rem 96px;
  max-width: 1100px;
  margin: 0 auto;
}

.page-section--first {
  padding-top: 148px;
}

/* --- Typography scale --- */
.eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1.75rem;
}

.heading-display {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
}

.heading-display em {
  font-style: italic;
  color: var(--text-secondary);
}

.heading-section {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
}

.body-text {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 46ch;
}

.body-small {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-secondary);
}

.label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.number-output {
  font-family: 'DM Mono', monospace;
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

.footer-note {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-tertiary);
}

/* --- Entry animation --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate { opacity: 0; animation: fadeUp 0.6s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }
.delay-4 { animation-delay: 0.5s; }
.delay-5 { animation-delay: 0.6s; }
.delay-6 { animation-delay: 0.75s; }

/* --- Responsive --- */
@media (max-width: 640px) {
  nav { padding: 0 1.5rem; }
  .page-section { padding: 0 1.5rem 56px; }
  .page-section--first { padding-top: 100px; }
  footer { padding: 2rem 1.5rem; }
}