/* dbgrid.tech home — studio identity. Used only by /index.html.
   Merrywick pages and 404 keep /style.css. */

@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #faf6ef;
  --bg-2: #f3ece1;
  --surface: #fffdf9;
  --ink: #1f1c18;
  --muted: #5f574c;
  --line: #e6dccd;
  --brand: #e0892f;
  --brand-ink: #9a520f;
  --focus: #1f5fbf;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 8px 24px -12px rgb(60 40 20 / 18%);
  --shadow-hover: 0 2px 4px rgb(60 40 20 / 8%), 0 18px 40px -16px rgb(60 40 20 / 28%);
  --radius: 22px;
  --tile: #fffaf0;

  /* product accents */
  --mw: #24306b;   --mw-on: #ffffff;
  --pp: #a84a22;   --pp-on: #ffffff;   --pp-tint: #f6e2d4;
  --fe: #1f7a6f;   --fe-on: #ffffff;   --fe-tint: #4ca36f;
  --mi: #2e5f49;   --mi-on: #ffffff;   --mi-tint: #e1ede6;
  --ro: #241e36;   --ro-on: #ffb547;   --ro-tint: #d3efea;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --bg-2: #1c1914;
    --surface: #211e19;
    --ink: #f3ede3;
    --muted: #b5ab9c;
    --line: #342f27;
    --brand: #f0a14f;
    --brand-ink: #f3b26c;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
    --shadow-hover: 0 2px 4px rgb(0 0 0 / 35%), 0 18px 40px -16px rgb(0 0 0 / 70%);
    --tile: #1d1b2f;

    --mw: #a9b8ff;   --mw-on: #12142a;
    --pp: #f2a47e;   --pp-on: #2a140a;   --pp-tint: #3a241a;
    --fe: #6fd3c4;   --fe-on: #0b2420;   --fe-tint: #2c6a49;
    --mi: #5db68c;   --mi-on: #0c1f16;   --mi-tint: #18261f;
    --ro: #ffb547;   --ro-on: #241e36;   --ro-tint: #2c2542;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

.wrap {
  width: min(100% - 2.5rem, 1120px);
  margin-inline: auto;
}

/* skip link */
.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
.mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  gap: 3px;
}
.mark span {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--ink);
}
.mark span:nth-child(4) { background: var(--brand); }

nav ul {
  display: flex;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav a {
  display: block;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  color: var(--muted);
}
nav a:hover { color: var(--ink); background: var(--bg-2); }
nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }

/* language switch */
.lang {
  display: flex;
  align-items: center;
  gap: .1rem;
  margin: 0 0 0 auto;
  font-weight: 800;
  font-size: .85rem;
  color: var(--line);
}
.lang a {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}
.lang a:hover { color: var(--ink); background: var(--bg-2); }
.lang a[aria-current] { color: var(--ink); }
.bar nav { margin-left: auto; }
.bar .lang { margin-left: .25rem; }

@media (max-width: 520px) {
  .brand { font-size: 1.2rem; }
  nav li:first-child { display: none; }
  nav a { padding: .4rem .55rem; font-size: .92rem; }
  .bar { gap: .5rem; }
  .lang a { min-width: 30px; }
}

/* hero */
.hero {
  padding-block: clamp(.9rem, 2vw, 1.25rem) clamp(.6rem, 1.5vw, .9rem);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1.1rem;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .02em;
  color: var(--brand-ink);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand);
}
.hero h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.lead {
  max-width: 46ch;
  margin: 1.3rem 0 0;
  font-size: clamp(1.08rem, 1.8vw, 1.25rem);
  color: var(--muted);
}

/* sections */
.section-title {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
.products { padding-bottom: clamp(3rem, 7vw, 5rem); }

/* grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .card--featured { grid-column: span 2; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* card */
.card {
  --accent: var(--ink);
  --on: var(--bg);
  --tint: var(--bg-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.card--merrywick { --accent: var(--mw); --on: var(--mw-on); }
.card--promise   { --accent: var(--pp); --on: var(--pp-on); --tint: var(--pp-tint); }
.card--festeiro  { --accent: var(--fe); --on: var(--fe-on); --tint: var(--fe-tint); }
.card--milheiro  { --accent: var(--mi); --on: var(--mi-on); --tint: var(--mi-tint); }
.card--rooftop   { --accent: var(--ro); --on: var(--ro-on); --tint: var(--ro-tint); }

.card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--surface) 55%, transparent) 0, transparent 62%),
    var(--tint);
}
.card--merrywick .card-media {
  background:
    radial-gradient(circle at 30% 45%, rgb(255 196 110 / 22%) 0, transparent 45%),
    linear-gradient(160deg, #1a2150 0%, #2a3576 60%, #39448a 100%);
}

.card--festeiro .card-media {
  background:
    repeating-linear-gradient(135deg, #e63946 0 14px, #f1c40f 14px 28px, #2a9d8f 28px 42px, #fffaf0 42px 56px) top / 100% 10px no-repeat,
    radial-gradient(circle at 50% 45%, rgb(255 255 255 / 16%) 0, transparent 60%),
    linear-gradient(160deg, #4ca36f 0%, #2a9d8f 100%);
}
@media (prefers-color-scheme: dark) {
  .card--festeiro .card-media {
    background:
      repeating-linear-gradient(135deg, #c8323e 0 14px, #d6ab0d 14px 28px, #23877b 28px 42px, #e9e2d3 42px 56px) top / 100% 10px no-repeat,
      radial-gradient(circle at 50% 45%, rgb(255 255 255 / 8%) 0, transparent 60%),
      linear-gradient(160deg, #2c6a49 0%, #1d5f57 100%);
  }
}

/* product showcase: screen or cover with the app icon as a corner badge */
.showcase {
  position: relative;
  margin: 0;
  line-height: 0;
}
.showcase .shot {
  width: 100%;
  height: auto;
}
.showcase .badge {
  position: absolute;
  left: -14px;
  bottom: -14px;
  width: clamp(48px, 17%, 64px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 24%;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 4px rgb(0 0 0 / 14%), 0 10px 22px -8px rgb(0 0 0 / 40%);
}
.showcase--cover {
  width: 42%;
  transform: rotate(-2deg);
  aspect-ratio: 720 / 848;
}
.showcase--cover .shot {
  border-radius: 6px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 14%), 0 16px 30px -12px rgb(60 30 10 / 50%);
}
.showcase--tv {
  width: 74%;
  padding: 6px;
  background: #16201c;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 18%), 0 18px 36px -14px rgb(0 0 0 / 55%);
}
.showcase--tv .shot { border-radius: 6px; }
.showcase--browser {
  width: 78%;
  overflow: visible;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--mi) 24%, transparent);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%), 0 18px 36px -14px rgb(20 50 35 / 45%);
}
.browser-bar {
  display: flex;
  gap: 5px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}
.browser-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.showcase--browser picture { display: block; }
.showcase--browser .shot { border-radius: 0 0 9px 9px; }

/* Rooftop: phone rising from the bottom edge of the panel */
.card--rooftop .card-media {
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 78%, rgb(255 181 71 / 30%) 0, transparent 46%),
    radial-gradient(circle at 74% 30%, rgb(134 216 204 / 45%) 0, transparent 50%),
    var(--tint);
}
@media (prefers-color-scheme: dark) {
  .card--rooftop .card-media {
    background:
      radial-gradient(circle at 28% 78%, rgb(255 181 71 / 16%) 0, transparent 46%),
      radial-gradient(circle at 74% 30%, rgb(134 216 204 / 14%) 0, transparent 50%),
      var(--tint);
  }
  .card--rooftop .showcase .badge { border-color: rgb(255 255 255 / 22%); }
}
.showcase--phone {
  align-self: end;
  width: 42%;
  margin-top: 9%;
  margin-bottom: -18%;
  padding: 5px 5px 0;
  background: #15111f;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), 0 18px 36px -14px rgb(20 12 40 / 60%);
}
.showcase--phone .shot { border-radius: 17px 17px 0 0; }
.showcase--phone .badge { left: -28%; bottom: auto; top: 46%; }
@media (prefers-color-scheme: dark) {
  .showcase--phone { box-shadow: 0 0 0 1px rgb(255 255 255 / 16%), 0 18px 36px -14px rgb(0 0 0 / 70%); }
}

.app-icon {
  width: clamp(104px, 30%, 132px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 24%;
  box-shadow: 0 2px 4px rgb(0 0 0 / 12%), 0 14px 30px -10px rgb(0 0 0 / 35%);
}
.tile {
  display: grid;
  place-items: center;
  background: var(--tile);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.tile img {
  width: 56%;
  height: auto;
  image-rendering: pixelated;
}

.phone-shot { display: none; }

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.35rem 1.5rem 1.6rem;
}
.tag {
  margin: 0 0 .35rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.card--merrywick .tag { color: var(--mw); }
.card h3 {
  margin: 0 0 .4rem;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.015em;
}
.desc {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: auto;
  min-height: 44px;
  padding: .6rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  transition: filter .15s ease, transform .15s ease;
}
.btn::after { content: "→"; transition: transform .15s ease; }
.btn.external::after { content: "↗"; }
.btn:hover { filter: brightness(1.1); }
.btn:hover::after { transform: translateX(2px); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn.ghost:hover { filter: none; box-shadow: inset 0 0 0 2px var(--muted); }

/* featured card (Merrywick) */
@media (min-width: 700px) {
  .card--featured { flex-direction: row; }
  .card--featured .card-media {
    flex: 1.15;
    aspect-ratio: auto;
    min-height: 260px;
    grid-template-columns: auto auto;
    gap: clamp(1rem, 3vw, 2rem);
    align-content: center;
    justify-content: center;
    padding: 1.5rem;
  }
  .card--featured .phone-shot {
    display: block;
    width: clamp(96px, 10vw, 118px);
    border-radius: 18px;
    border: 4px solid #0d1030;
    box-shadow: 0 18px 36px -12px rgb(0 0 0 / 55%);
  }
  .card--featured .card-body {
    flex: 1;
    justify-content: center;
    padding: 2rem;
  }
  .card--featured h3 { font-size: 1.75rem; }
}

/* "more on the way" card */
.card--next {
  background: transparent;
  border: 2px dashed var(--line);
  box-shadow: none;
}
.card--next:hover { transform: none; box-shadow: none; }
.card--next .tag { color: var(--brand-ink); }
.card--next .card-body { justify-content: center; }

/* contact */
.contact { padding-bottom: clamp(3rem, 7vw, 5rem); }
.contact-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact-panel .section-title { margin-bottom: .35rem; }
.contact-panel p { margin: 0; color: var(--muted); }
.btn.mail {
  --accent: var(--ink);
  --on: var(--bg);
  margin-top: 0;
  overflow-wrap: anywhere;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .95rem;
}
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 2rem;
  padding-block: 1.75rem 2.25rem;
}
.foot p { margin: 0; }
.card--next .btn { margin-top: 0; }
@media (min-width: 700px) { .card--featured .btn { margin-top: 0; } }

.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;
}

/* Merrywick: fan of three phones filling the blue panel */
.fan {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 230px;
}
.card--merrywick .card-media { padding: 0; overflow: hidden; }
.fan .phone-shot {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  height: 86%;
  width: auto;
  border-radius: 16px;
  border: 4px solid #0d1030;
  box-shadow: 0 18px 36px -12px rgb(0 0 0 / 55%);
}
.fan .ps-c { z-index: 2; transform: translate(-50%, -50%); }
.fan .ps-l { height: 74%; transform: translate(-128%, -48%) rotate(-7deg); opacity: .92; }
.fan .ps-r { height: 74%; transform: translate(28%, -48%) rotate(7deg); opacity: .92; }
.fan .app-icon {
  position: absolute;
  z-index: 3;
  left: 6%;
  bottom: 7%;
  width: clamp(54px, 13%, 84px);
  border: 2px solid rgb(255 255 255 / 85%);
}
@media (min-width: 700px) {
  .card--featured .card-media { padding: 0; display: block; }
  .card--featured .card-media { flex: 1.3; }
  .card--featured .fan { min-height: 360px; }
  .card--featured .fan .phone-shot { width: auto; height: 72%; border-radius: 20px; border-width: 5px; }
  .card--featured .fan .ps-l,
  .card--featured .fan .ps-r { height: 60%; }
  .card--featured .fan .ps-l { transform: translate(-112%, -47%) rotate(-6deg); }
  .card--featured .fan .ps-r { transform: translate(12%, -47%) rotate(6deg); }
}

/* Promise Path: cover with two comic panels behind it */
.collage { overflow: hidden; }
.collage .showcase--cover {
  position: relative;
  z-index: 2;
  width: 45%;
  transform: rotate(-2deg);
}
.collage .panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46%;
  height: auto;
  border: 4px solid #fffaf3;
  border-radius: 4px;
  box-shadow: 0 10px 24px -10px rgb(60 30 10 / 45%);
}
.collage .pn-l { transform: translate(-96%, -70%) rotate(-7deg); }
.collage .pn-r { transform: translate(-4%, -26%) rotate(6deg); }
