/* ============================================================
   Zeugma Code — zeugmacode.com
   Mosaic identity · system fonts · mobile-first · sub-1s budget
   ============================================================ */

:root {
  /* Palette — mosaic glaze */
  --ink:        #0c1f24;
  --ink-2:      #102a30;
  --tessera:    #14756e;   /* teal   */
  --terracotta: #c8473b;   /* clay   — brand link to Jigsaw Maker */
  --gold:       #d6a13a;   /* gilt   */
  --lapis:      #2f6f9f;   /* blue   */

  /* Text-safe accent variants (>=4.5:1 on white/stone) for coloured TEXT.
     Bright versions above stay for bars, glyphs and the hero mosaic. */
  --terracotta-text: #b23d31;
  --tessera-text:    #0f6a61;
  --lapis-text:      #2b6a98;
  --gold-text:       #8a6410;
  --terracotta-lite: #e8836f;  /* terracotta on dark (footer wordmark) */

  --shell:      #f6f3ec;   /* warm stone background */
  --shell-2:    #efe9dd;
  --line:       #dcd5c6;
  --text:       #1c2b2e;
  --muted:      #5d6b6c;
  --muted-ink:  #9fb6b4;

  /* Type */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "Segoe UI Mono",
          Consolas, "Liberation Mono", monospace;

  /* Rhythm */
  --maxw: 1140px;
  --gut: clamp(1.1rem, 4vw, 2.4rem);
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--shell);
  line-height: 1.6;
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

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

/* ── Shared bits ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; background: currentColor; opacity: .8;
}
.eyebrow--dark { color: var(--tessera); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: .98rem; text-decoration: none;
  padding: .82rem 1.5rem; border-radius: 999px;
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn--solid { background: var(--gold); color: var(--ink); }
.btn--solid:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(214,161,58,.7); }
.btn--ghost { color: var(--shell); border: 1.5px solid rgba(246,243,236,.4); }
.btn--ghost:hover { background: rgba(246,243,236,.1); border-color: var(--shell); }

/* ── Header ──────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  padding: .7rem var(--gut);
  background: color-mix(in srgb, var(--shell) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand__mark { flex: none; }
.brand__name {
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -.01em; color: var(--ink);
}
.brand__accent { color: var(--terracotta-text); }

.site-nav { display: flex; align-items: center; gap: clamp(.6rem, 2.5vw, 1.6rem); }
.site-nav a { text-decoration: none; font-weight: 550; font-size: .95rem; color: var(--text); }
.site-nav a:not(.site-nav__cta):hover { color: var(--tessera); }
.site-nav__cta {
  background: var(--ink); color: var(--shell) !important;
  padding: .5rem 1rem; border-radius: 999px;
  white-space: nowrap;
}
.site-nav__cta:hover { background: var(--tessera); }

/* Narrow screens: drop the in-page links, keep brand + the contact CTA.
   The hero's "Explore the apps" button covers section navigation. */
@media (max-width: 520px) {
  .site-nav { gap: .7rem; }
  .site-nav a:not(.site-nav__cta) { display: none; }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(120% 120% at 100% 0%, var(--ink-2), var(--ink) 60%);
  color: var(--shell);
  padding: clamp(2.6rem, 7vw, 5.5rem) var(--gut) clamp(3rem, 8vw, 6rem);
  position: relative;
  overflow: hidden;
}
.hero__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
}
.hero__copy { max-width: 36rem; margin-inline: auto; width: 100%; }

.hero h1 {
  font-size: clamp(2.4rem, 7.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 800;
  margin: 0 0 1.2rem;
}
.hero h1 .dot { color: var(--gold); }
.hero__lede {
  font-size: clamp(1.05rem, 1rem + .5vw, 1.25rem);
  color: var(--muted-ink);
  max-width: 34rem;
  margin: 0 0 2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.3rem; }

.hero__facts {
  list-style: none; margin: 0; padding: 1.5rem 0 0;
  display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 5vw, 2.6rem);
  border-top: 1px solid rgba(246,243,236,.14);
  font-family: var(--mono); font-size: .82rem;
  color: var(--muted-ink); text-transform: uppercase; letter-spacing: .08em;
}
.hero__facts span {
  display: block; font-size: 1.7rem; color: var(--shell);
  letter-spacing: -.02em; margin-bottom: .15rem; font-weight: 600;
}

/* ── Signature: rotating 3D mosaic cube ──────────────────── */
.hero__mosaic { justify-self: center; width: min(82%, 360px); }
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  perspective: 1100px;
  --size: clamp(150px, 34vw, 230px);
}
/* soft contact shadow */
.scene::after {
  content: ""; position: absolute; left: 50%; bottom: 7%;
  width: 58%; height: 13%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.5), transparent 72%);
  filter: blur(5px); z-index: -1;
}

.cube {
  width: var(--size); height: var(--size);
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-32deg);   /* attractive no-JS default */
  animation: cube-spin 28s linear infinite;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}
.cube.dragging { cursor: grabbing; }
@keyframes cube-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}

.face {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-template-areas: "a b c" "a d d" "e f g";
  gap: clamp(4px, 1.7%, 7px);
  padding: clamp(4px, 1.7%, 7px);
  background: #0b1c20;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  backface-visibility: hidden;
}
.face::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; background: #000; opacity: var(--shade, 0);
}
.face--front  { transform: translateZ(calc(var(--size) / 2)); --shade: .04; }
.face--back   { transform: rotateY(180deg) translateZ(calc(var(--size) / 2)); --shade: .4; }
.face--right  { transform: rotateY(90deg)  translateZ(calc(var(--size) / 2)); --shade: .24; }
.face--left   { transform: rotateY(-90deg) translateZ(calc(var(--size) / 2)); --shade: .32; }
.face--top    { transform: rotateX(90deg)  translateZ(calc(var(--size) / 2)); --shade: 0; }
.face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--size) / 2)); --shade: .46; }
.face--top::after { background: #fff; opacity: .07; }

.ct { background: var(--c); border-radius: 6px; }

/* ── Section heads ───────────────────────────────────────── */
.section-head { max-width: var(--maxw); margin: 0 auto clamp(1.8rem, 4vw, 2.8rem); }
.section-head h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.7rem);
  line-height: 1.08; letter-spacing: -.03em; font-weight: 780;
  margin: 0; max-width: 18ch;
}
.section-head__sub { color: var(--muted); max-width: 46ch; margin: .9rem 0 0; }

/* ── Apps mosaic ─────────────────────────────────────────── */
.apps { padding: clamp(3rem, 8vw, 6rem) var(--gut); }
.mosaic-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}

.tile {
  position: relative;
  display: flex; flex-direction: column;
  padding: 1.6rem 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: var(--accent, var(--tessera));
}
a.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -22px rgba(12,31,36,.55);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.tile__tag {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-text, var(--tessera-text));
  margin: 0 0 .9rem; font-weight: 600;
}
.tile__name {
  font-size: 1.4rem; line-height: 1.1; letter-spacing: -.02em;
  margin: 0 0 .55rem; font-weight: 740;
}
.tile__desc { color: var(--muted); margin: 0 0 1.4rem; font-size: .98rem; }
.tile__desc code {
  background: var(--shell-2); padding: .05em .35em; border-radius: 5px; color: var(--ink);
}
.tile__go {
  margin-top: auto; font-weight: 650; font-size: .95rem;
  color: var(--ink); display: inline-flex; align-items: center; gap: .45rem;
  text-decoration: none;
}
.tile__go .arr { transition: transform .18s ease; color: var(--accent-text, var(--tessera-text)); }
a.tile:hover .tile__go .arr,
.tile__go:hover .arr { transform: translateX(4px); }

.tile--feature {
  background:
    radial-gradient(130% 130% at 0% 0%, color-mix(in srgb, var(--terracotta) 14%, #fff), #fff 62%);
}
.tile--feature .tile__name { font-size: 1.85rem; }
.tile--feature .tile__desc { font-size: 1.05rem; max-width: 40ch; }

.tile--more { background: var(--shell-2); border-style: dashed; }
.tile--more::before { opacity: .5; }

/* ── Approach ────────────────────────────────────────────── */
.approach {
  background: var(--ink);
  color: var(--shell);
  padding: clamp(3rem, 8vw, 6rem) var(--gut);
}
.approach .section-head h2 { color: var(--shell); }
.principles {
  max-width: var(--maxw); margin: 0 auto; padding: 0; list-style: none;
  display: grid; grid-template-columns: 1fr; gap: 0;
}
.principle {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(246,243,236,.14);
  display: grid; gap: .4rem;
}
.principle:last-child { border-bottom: 1px solid rgba(246,243,236,.14); }
.principle__label {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold); margin: 0; font-weight: 600;
}
.principle__body { color: var(--muted-ink); margin: 0; max-width: 60ch; }

/* ── Footer ──────────────────────────────────────────────── */
.site-foot {
  background: var(--ink-2); color: var(--muted-ink);
  padding: clamp(2.2rem, 5vw, 3.2rem) var(--gut);
  display: grid; gap: .7rem; text-align: center;
  border-top: 1px solid rgba(246,243,236,.1);
}
.site-foot__brand {
  display: inline-flex; align-items: center; gap: .55rem; justify-content: center;
  font-family: var(--mono); font-weight: 700; color: var(--shell); font-size: 1.05rem;
}
.site-foot__brand .brand__accent { color: var(--terracotta-lite); }
.site-foot__line { margin: 0; }
.site-foot__mail { color: var(--gold); font-family: var(--mono); font-size: .9rem; text-decoration: none; }
.site-foot__mail:hover { text-decoration: underline; }
.site-foot__cr { margin: .3rem 0 0; font-size: .82rem; color: var(--muted-ink); }

/* ── Responsive: tablet ──────────────────────────────────── */
@media (min-width: 640px) {
  .mosaic-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
  }
  .tile--feature { grid-column: 1 / -1; }
  .principles { grid-template-columns: repeat(2, 1fr); gap: 0 clamp(2rem, 5vw, 4rem); }
  .principle { border-top: 1px solid rgba(246,243,236,.14); }
}

/* ── Responsive: desktop ─────────────────────────────────── */
@media (min-width: 920px) {
  .hero { padding-block: clamp(4rem, 7vw, 7rem); }
  .hero__inner {
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
  }
  .hero__copy { margin-inline: 0; }
  .hero__mosaic { width: min(100%, 420px); justify-self: end; }

  .mosaic-grid { grid-template-columns: repeat(3, 1fr); }
  .tile--feature { grid-column: span 2; grid-row: span 2; }
  .tile--more { grid-column: span 2; }
}

/* ── Motion / contrast prefs ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
  .cube { animation: none !important; transform: rotateX(-24deg) rotateY(-32deg); }
}
