/* tussna.org — landing page for the Tussna project family.
   Design language shared with tales.tussna.org / tifinagh.tussna.org /
   dictionary.tussna.org: warm parchment, Literata + Inter, restrained
   earth accents — with the Tussna app's red (#eb4a4a) as the brand. */

@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-serif: 'Literata', 'Iowan Old Style', Georgia, 'Noto Serif', serif;
  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --bg: #f7f2e7;
  --bg-elev: #fffdf7;
  --bg-soft: #efe7d6;
  --ink: #221c17;
  --ink-soft: #55483a;
  --muted: #7b6f60;
  --line: #e2d8c6;
  --line-strong: #d2c5ad;

  --red: #eb4a4a;        /* Tussna app brand */
  --red-deep: #c12e2e;
  --teal: #2f5d62;       /* dictionary */
  --terracotta: #b0522a; /* tales */
  --gold: #b98a2f;       /* wiki */
  --rust: #7d3019;       /* tifinaghdb */
  --olive: #5f7040;      /* amazigh archive */
  --plum: #7a4b63;       /* Kabyle spellchecker */

  --shadow: 0 1px 2px rgba(34, 28, 23, .06), 0 8px 24px rgba(34, 28, 23, .07);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.inner { padding: 0 32px; }
@media (max-width: 640px) { .inner { padding: 0 20px; } }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 242, 231, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.mark { width: 24px; height: 24px; }

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .01em;
}

.site-nav { display: flex; align-items: center; gap: 28px; }

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .925rem;
  font-weight: 500;
  transition: color .15s ease;
}

.site-nav a:hover { color: var(--red-deep); }

.site-nav .nav-cta {
  color: var(--red-deep);
  border: 1px solid color-mix(in srgb, var(--red-deep) 45%, transparent);
  border-radius: 999px;
  padding: 7px 16px;
  transition: background-color .15s ease, color .15s ease;
}

.site-nav .nav-cta:hover {
  background: var(--red-deep);
  color: #fffdf7;
}

@media (max-width: 560px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- hero ---------- */

.hero {
  padding: 88px 0 72px;
  text-align: center;
  background:
    radial-gradient(1100px 420px at 50% -80px, rgba(235, 74, 74, .07), transparent 70%),
    var(--bg);
}

.hero h1 {
  margin: 0 auto;
  max-width: 21ch;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -.015em;
}

.hero-sub {
  margin: 22px auto 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.hero-sub em { font-style: italic; }

.hero-cta {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--red);
  color: #fffdf7;
}

.btn-primary:hover { background: var(--red-deep); }

.btn-ghost {
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
}

.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red-deep);
}

.btn:hover { transform: translateY(-1px); }

/* ---------- section scaffolding ---------- */

.projects, .about { padding: 56px 0 72px; scroll-margin-top: 76px; }

.about {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 10px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-deep);
}

h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -.01em;
}

.section-sub { margin: 12px 0 0; color: var(--muted); max-width: 60ch; }

/* ---------- projects grid ---------- */

.projects-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.card {
  --c: var(--red);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  grid-column: span 2;
  padding: 26px 26px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--c);
  opacity: .85;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
  box-shadow: 0 2px 4px rgba(34, 28, 23, .07), 0 14px 34px rgba(34, 28, 23, .10);
}

.card:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 3px;
}

/* The last row pairs the archive and the TikTok channel in the centre. */
.card-pair-left { grid-column: 2 / span 2; }
.card-pair-right { grid-column: 4 / span 2; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 10px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 9%, var(--bg-elev));
}

.card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-kicker {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h3 {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: .93rem;
  line-height: 1.55;
  flex-grow: 1;
}

.card p em { font-style: italic; }

.visit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--c);
}

.visit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

.card:hover .visit svg { transform: translateX(4px); }

@media (max-width: 880px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .card { grid-column: span 1; }
  .card-pair-left, .card-pair-right { grid-column: span 1; }
}
@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
  .card { grid-column: auto; }
  .card-pair-left, .card-pair-right { grid-column: auto; }
  .hero { padding: 56px 0 48px; }
}

/* ---------- about / principles ---------- */

.principles {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.principle {
  padding: 26px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.principle-mark {
  margin: 0 0 12px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--red);
}

.principle h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
}

.principle p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .93rem;
}

@media (max-width: 880px) {
  .principles { grid-template-columns: 1fr; }
  .principle { padding: 22px; }
}

/* ---------- footer ---------- */

.site-footer {
  background: #241d16;
  color: #cfc4b2;
  padding: 48px 0 36px;
}

.footer-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-footer, .brand-footer .brand-name { color: #f3ecdd; }

.footer-tag { margin: 0; font-size: .95rem; color: #a99c88; }
.footer-tag em { font-style: italic; color: #cfc4b2; }

.footer-nav {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #3a3128;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.footer-nav a {
  color: #cfc4b2;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
}

.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.footer-legal {
  margin: 26px 0 0;
  font-size: .82rem;
  color: #8a7f6e;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .card:hover, .btn:hover { transform: none; }
}
