/* ==========================================================================
   Homset — site styles, "workshop" direction
   Warm paper canvas, serif headlines, and the logo's slanted ribbons as the
   recurring motif. Logo colours are accents only; text and link colours are
   the darkened *-ink variants so they hold AA contrast (tests/test_contrast.py
   reads the tokens below and checks every text/background pair we use).
   ========================================================================== */

@font-face {
  font-family: "Inter var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces var";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
}

/* --------------------------------------------------------------- tokens */
:root {
  --sans: "Inter var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces var", "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* logo colours: accents and decoration only */
  --blue: #00aeef;
  --green: #8cc63f;
  --orange: #f7941e;
  --yellow: #fef201;
  --forest: #006f45;

  /* surfaces */
  --paper: #f5efe3;
  --raised: #fffaf0;
  --white: #ffffff;

  /* text */
  --ink: #26221c;
  --body: #4a4338;
  --muted: #6b6255;
  --line: #e4dbc8;
  --line-strong: #cfc3aa;

  /* ink-safe accents (AA on paper and raised) */
  --blue-ink: #0073a1;
  --green-ink: #456f10;
  --orange-ink: #9a5300;
  --amber-ink: #7f5c00;

  /* chips */
  --chip-amber-bg: #f3e2b3;
  --chip-amber-ink: #7a5600;
  --chip-gray-bg: #ebe4d4;
  --chip-gray-ink: #5b5346;

  /* footer (dark) */
  --footer-bg: #1f1b16;
  --footer-text: #a89f8f;
  --footer-link: #e9e2d3;
  --footer-muted: #8f8778;

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, .06);
  --shadow-md: 0 18px 36px -22px rgba(60, 40, 10, .35);
  --container: 1120px;
  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  font-feature-settings: "cv05" 1, "ss03" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 1.6rem + 4.2vw, 5rem); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.8rem); }
h3 { font-size: 1.3rem; }

h1 em, h2 em { font-style: italic; color: var(--orange-ink); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .35em;
}

::selection { background: var(--chip-amber-bg); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--blue-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------ utilities */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 10px;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* small slanted bar before eyebrows: the ribbon angle, in miniature */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1em;
}
.eyebrow::before {
  content: "";
  width: 1.3em;
  height: .55em;
  background: currentColor;
  transform: skewX(-31deg);
}
.eyebrow--brand  { color: var(--ink); }
.eyebrow--blue   { color: var(--blue-ink); }
.eyebrow--green  { color: var(--green-ink); }
.eyebrow--orange { color: var(--orange-ink); }
.eyebrow--amber  { color: var(--amber-ink); }

.lede {
  font-size: clamp(1.08rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.6;
  color: var(--body);
  max-width: 62ch;
}

.note { color: var(--muted); font-size: .95rem; margin-top: 2rem; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, transform .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--forest); color: var(--white); }
.btn--primary:hover { background: #005c39; }
.btn--primary:focus-visible { outline-color: var(--forest); }

.btn--ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--small { padding: 10px 18px; font-size: .9rem; }

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  vertical-align: middle;
  margin-left: .5em;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3em .7em;
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: .5em; height: .5em;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}
.chip--amber { background: var(--chip-amber-bg); color: var(--chip-amber-ink); }
.chip--gray  { background: var(--chip-gray-bg); color: var(--chip-gray-ink); }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 239, 227, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; }
.brand img { height: 40px; width: auto; display: block; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a:not(.btn) {
  display: block;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--body);
  font-weight: 550;
  font-size: .95rem;
  transition: color .15s ease, background-color .15s ease;
}
.site-nav a:not(.btn):hover { color: var(--ink); background: var(--raised); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); }
.nav-cta { margin-left: 10px; }

.nav-lang { margin-left: 6px; font-size: .85rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.nav-lang [aria-current] { color: var(--ink); }
.site-nav .nav-lang a:not(.btn) { display: inline; padding: 2px 4px; }

.nav-toggle {
  display: none;
  background: var(--raised);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar::before { transform: translateY(-6px); }
.nav-toggle-bar::after  { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { transform: rotate(-45deg) translateY(-1px); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(3.5rem, 7vw, 6.5rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-copy .lede { margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
}

/* the real logo mark, large and unboxed, with the Denario card below it (never over it) */
.hero-mark {
  position: absolute;
  top: 0;
  right: -1rem;
  height: calc(100% - 7.5rem);
  width: auto;
  max-width: none;
  pointer-events: none;
}

.hero-peek {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 350px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  color: var(--body);
  transition: transform .2s ease;
}
.hero-peek:hover { text-decoration: none; transform: translateY(-3px); }
.hero-peek .app-icon { width: 56px; height: 56px; border-radius: 14px; }
.hero-peek-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .15em;
}
.hero-peek .app-tagline { font-size: .9rem; line-height: 1.4; }
.hero-peek-title, .hero-peek .app-tagline { display: block; }

/* Slide only, never fade: the copy is visible from the first paint. */
@keyframes rise {
  from { transform: translateY(14px); }
  to   { transform: none; }
}
.hero-copy > *, .hero-visual { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
.hero-visual { animation-delay: .2s; }

/* ------------------------------------------------------------- sections */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section--tint {
  background: var(--raised);
  border-block: 1px solid var(--line);
}
.section--tint .card { background: var(--paper); }
.section--flush { padding-top: clamp(2rem, 4vw, 3rem); }

.section-head { max-width: 760px; margin-bottom: clamp(2.2rem, 4vw, 3.4rem); }
.section-head .lede { margin-bottom: 0; }
.section-head--left { margin-bottom: 0; }

/* -------------------------------------------- big number + prose sections */
.split {
  display: grid;
  grid-template-columns: minmax(200px, .5fr) 1.5fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.stat-number {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4.5rem, 3rem + 8vw, 9rem);
  line-height: .85;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin: 0 0 .2em;
}
.stat--blue .stat-number  { color: var(--blue-ink); }
.stat--green .stat-number { color: var(--green-ink); }
.stat-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.split-body .lede + .lede { margin-top: 1rem; }

/* ---------------------------------------------------------------- cards */
.cards { display: grid; gap: 22px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.cards--apps { grid-template-columns: 1.08fr .92fr; align-items: stretch; }

.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }

.card h3 { margin-bottom: .4em; }
.card p { font-size: .97rem; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }

.card--blue   .card-icon { color: var(--blue-ink); }
.card--green  .card-icon { color: var(--green-ink); }
.card--orange .card-icon { color: var(--orange-ink); }
.card--amber  .card-icon { color: var(--amber-ink); }

/* ----------------------------------------------------------- apps cards */
.app-card { display: flex; flex-direction: column; gap: 16px; }
.app-card > p { flex: 1 0 auto; }

.app-card-head { display: flex; align-items: center; gap: 18px; }
.app-card-head h3 { margin-bottom: .15em; }

.app-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  flex: none;
  object-fit: contain;
}
.app-icon--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
}
.app-icon--placeholder svg { width: 26px; height: 26px; }

.app-tagline { color: var(--muted); font-size: .95rem; margin: 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li {
  font-size: .8rem;
  font-weight: 550;
  color: var(--body);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 11px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  color: var(--forest);
}
.text-link svg { width: 17px; height: 17px; transition: transform .18s ease; }
.text-link:hover { text-decoration: none; }
.text-link:hover svg { transform: translateX(3px); }

/* ------------------------------------------------------- feature block */
.feature {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.6rem, 3.5vw, 2.8rem);
  margin-bottom: 26px;
}
.feature--ghost {
  grid-template-columns: 1fr;
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
}
.feature .app-card-head { margin-bottom: 18px; }
.feature h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); margin-bottom: .1em; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }

.feature-art { display: flex; justify-content: center; }
.feature-stage {
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: clamp(1.6rem, 3vw, 2.6rem);
  background: var(--paper);
}
.feature-stage img {
  display: block;
  width: min(100%, 260px);
  filter: drop-shadow(0 18px 24px rgba(60, 40, 10, .18));
}

/* -------------------------------------------------------------- contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact-actions { margin-top: 1.7rem; }

.contact-details { margin: 0; }
.contact-item { border-top: 1px solid var(--line-strong); padding: 16px 0; }
.contact-item:last-child { border-bottom: 1px solid var(--line-strong); }
.contact-item dt {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.contact-item dd { margin: 0; color: var(--ink); font-weight: 500; }
.contact-item a { color: var(--forest); }

/* ------------------------------------------------------------ page hero */
.page-hero { padding: clamp(3rem, 6vw, 5rem) 0 clamp(1rem, 2vw, 1.5rem); }
.page-hero .lede { margin-top: .4rem; }

.app-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.app-hero-art { display: flex; justify-content: center; }

/* --------------------------------------------------------------- footer */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.6rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.site-footer a { color: var(--footer-link); }
.site-footer a:hover { color: var(--white); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 36px;
  padding-bottom: 2.6rem;
}

.footer-brand img { height: 52px; width: auto; display: block; margin-bottom: 16px; }
.footer-tagline { font-size: .93rem; line-height: 1.6; margin: 0; }

.footer-col h2 {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--footer-muted);
  margin-bottom: 14px;
}
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: .95rem; }
.footer-legal p { font-size: .9rem; line-height: 1.75; margin: 0; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(245, 239, 227, .12);
  padding-top: 1.4rem;
  font-size: .85rem;
}
.footer-bottom p { margin: 0; }
.footer-note { color: var(--footer-muted); }

/* ------------------------------------------------- 404 and language chooser */
.page-404 .notfound {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}
.page-404 .notfound section + section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line-strong);
}
.brand--404 img { height: 84px; width: auto; margin-bottom: 28px; }
.notfound h1 { max-width: 18ch; margin-inline: auto; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
.notfound .lede { margin-inline: auto; }
.notfound .feature-actions { justify-content: center; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .footer-legal { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .header-inner { position: relative; }

  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open {
    display: block;
    position: absolute;
    top: calc(100% + 10px);
    left: 24px; right: 24px;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 10px;
  }
  .js .site-nav.is-open ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .js .site-nav.is-open a:not(.btn) { border-radius: 10px; padding: 12px 14px; }
  .js .site-nav.is-open .nav-lang { margin: 6px 14px; }
  .js .site-nav.is-open .nav-lang a:not(.btn) { display: inline; padding: 2px 4px; }
  .js .nav-cta { margin: 8px 4px 4px; }
  .js .nav-cta .btn { width: 100%; }
  :root:not(.js) .nav-toggle { display: none; }
  :root:not(.js) .header-inner { flex-wrap: wrap; padding-block: 10px; }
  :root:not(.js) .site-nav ul { flex-wrap: wrap; }

  .split { grid-template-columns: 1fr; gap: 1.2rem; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 430px; }
  .hero-mark { right: 0; height: calc(100% - 7rem); }

  .cards--3 { grid-template-columns: 1fr; }
  .cards--apps { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature-art { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .app-hero-grid { grid-template-columns: 1fr; }
  .app-hero-art { order: -1; }
}

@media (max-width: 620px) {
  .cards--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-legal { grid-column: 1 / -1; }
  .feature-stage img { width: min(100%, 200px); }
  .brand img { height: 32px; }
  .btn { padding: 14px 20px; }
}

/* --------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
