/* Nightfang Studios — shared styles for nightfang.de and moonbite.nightfang.de */

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

:root {
  --night: #2b1653;
  --night-deep: #1f1040;
  --ink: #1a1030;
  --moon: #ffe08a;
  --lavender: #c7b2ff;
  --violet: #6a3fd6;
  --cream: #fff7ee;
  --accent: #ff4d6d;

  /* edges: outlines and lift shadows of boxes and buttons. Lighter than --ink so they show on the night background */
  --edge: #3e3558;
  --border: 3px solid var(--edge);
  --shadow: 5px 5px 0 var(--edge);          /* boxes and buttons */
  --shadow-hover: 7px 7px 0 var(--edge);    /* lifted on hover (with translate(-2px, -2px)) */
  --shadow-lg: 8px 8px 0 var(--edge);       /* big featured pieces: app card, phone frames */
  --radius: 22px;                            /* panels, FAQ cards */
  --radius-lg: 28px;                         /* the big app card */
  --gutter: 16px;
  --grid-gap: 20px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }
/* in-page links ("See our apps") glide down instead of jumping; the heading stops a little below the top edge */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
[id] { scroll-margin-top: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--cream);
  font-family: ui-rounded, "Nunito", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

main { flex: 1; }

img, svg { max-width: 100%; height: auto; }

a { color: var(--lavender); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--moon); }
/* one focus ring everywhere */
a:focus-visible, .button:focus-visible, .paw-egg:focus-visible, .bat-egg:focus-visible, .faq details:has(summary:focus-visible) {
  outline: 3px solid var(--moon);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-weight: 900;
  line-height: 1.15;
  color: var(--moon);
  text-shadow: 3px 3px 0 var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); letter-spacing: .01em; margin-bottom: 16px; }
/* one rhythm: 56px between sections, 20px from a heading to what it heads */
h2 { margin-bottom: 20px; }
h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
h3 { font-size: 1.25rem; }

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header { padding: 22px 0 8px; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-header .logo { display: inline-block; line-height: 0; }
.site-header .logo img { height: 46px; width: auto; }
.site-header .deco { width: 44px; flex: none; }
/* Easter egg (Moonbite home): the header paw walks to the app icon and bites it. Script at the end of moonbite/index.html. */
.paw-egg { display: block; line-height: 0; cursor: pointer; flex: none; padding: 0; border: 0; background: none; border-radius: 12px; }
.paw-egg .deco { transition: opacity .3s ease, transform .3s ease; }
.paw-egg.is-away .deco { opacity: 0; transform: scale(.6); }
.icon-bite { display: block; position: relative; width: 104px; height: 104px; margin-bottom: 20px; }
.icon-bite .app-icon { margin: 0; }
.bite-layer { position: absolute; inset: 0; border-radius: 24px; overflow: hidden; pointer-events: none; }
/* second layer covers the icon's offset drop shadow, so the shadow is bitten too */
.bite-layer--shadow { transform: translate(5px, 5px); }
.bite-layer .bite {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; background: var(--night); border: var(--border); transform: scale(0);
}
.bite-layer--shadow .bite { border: 0; translate: -5px -5px; }
.bite-layer .bite:nth-child(1) { left: 106px; top: 30px; }
.bite-layer .bite:nth-child(2) { left: 102px; top: 52px; }
.icon-bite.is-bitten .bite { transform: none; }
.paw-layer { position: absolute; left: 0; top: 0; z-index: 10; pointer-events: none; }
.paw-print, .paw-walker { position: absolute; background: url("/assets/deco/paw.svg") center / contain no-repeat; }
.paw-print { opacity: 0; }
.paw-print.is-down { opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .paw-egg:hover:not(.is-away) .deco { transform: rotate(-10deg); }
  .paw-print.is-down { animation: egg-print .25s ease-out; }
  .icon-bite.is-bitten .bite { animation: egg-bite .12s ease-out; }
  .icon-bite.is-bitten .app-icon { animation: egg-shake .4s ease-in-out .05s; }
}
@keyframes egg-print { from { opacity: 0; scale: 1.5; } to { opacity: .55; scale: 1; } }
@keyframes egg-bite { from { transform: scale(0); } to { transform: none; } }
@keyframes egg-shake { 0%, 100% { transform: none; } 25% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } }
.logo--studio { display: inline-flex !important; flex-direction: column; align-items: flex-end; gap: 0; text-decoration: none; line-height: 1 !important; }
.studio-tag { font-weight: 900; font-size: 0.95rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--lavender); text-shadow: 2px 2px 0 var(--ink); margin-right: -0.22em; margin-top: -8px; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }

/* Hero */
.hero { padding: 32px 0 28px; position: relative; }
.hero p.lead { font-size: 1.2rem; max-width: 34ch; margin: 0 0 24px; }
/* Keep the lead's first sentence on one line where it fits (wraps normally on phones) */
.hero--split p.lead { max-width: none; }
@media (min-width: 560px) { .lead .line { white-space: nowrap; } }
.hero .app-icon {
  width: 104px; height: 104px;
  border-radius: 24px;
  border: var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  display: block;
}
.hero .deco-bat { position: absolute; right: 0; top: 18px; width: 96px; transform: rotate(8deg); opacity: .95; }
/* Easter egg (nightfang.de home): the bat is a button; the flight is in the script at the end of nightfang/index.html */
.bat-egg { padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 12px; }
/* the SVG has 12/24 units of room round the 96x48 bat for the wing tips; size it so the bat itself fills the button */
.bat-egg svg { display: block; width: 125%; max-width: none; height: auto; overflow: visible; margin: -25% -12.5%; }
/* wings hinge at the shoulders (SVG user units) */
.bat-egg .wing, .hop-bat .wing { transform-box: view-box; }
.bat-egg .wing--l, .hop-bat .wing--l { transform-origin: 44px 16px; }
.bat-egg .wing--r, .hop-bat .wing--r { transform-origin: 52px 16px; }
.hop-bat .wing--l { animation: bat-flap-l .18s ease-in-out infinite; }
.hop-bat .wing--r { animation: bat-flap-r .18s ease-in-out infinite; }
@media (prefers-reduced-motion: no-preference) {
  .bat-egg.is-flying .wing--l { animation: bat-flap-l .2s ease-in-out infinite; }
  .bat-egg.is-flying .wing--r { animation: bat-flap-r .2s ease-in-out infinite; }
}
/* upstroke: tips rise and wings stretch; downstroke: tips sweep down and fold in a little */
@keyframes bat-flap-l { 0%, 100% { transform: none; } 30% { transform: rotate(28deg); } 75% { transform: rotate(-22deg) scaleX(.8); } }
@keyframes bat-flap-r { 0%, 100% { transform: none; } 30% { transform: rotate(-28deg); } 75% { transform: rotate(22deg) scaleX(.8); } }

section { padding: 28px 0; }
section > :last-child { margin-bottom: 0; }

/* Comic panel */
.panel {
  background: var(--night-deep);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.panel > :last-child { margin-bottom: 0; }
.panel h3 { font-size: 1.2rem; margin: 0 0 8px; }


/* Lift on hover: the same for buttons and FAQ cards */
@media (prefers-reduced-motion: no-preference) {
  .button, .faq details { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
  a.button:hover, .faq details:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hover); }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--moon);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 12px 24px;
  text-decoration: none;
  /* every button the same size: wide enough for the longest label ("Coming to the App Store"), text centred */
  min-width: 19rem;
  max-width: 100%;
  justify-content: center;
  text-align: center;
}
a.button:hover { color: var(--ink); }
.button--disabled { background: var(--lavender); cursor: default; }



/* Long text */
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.45rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--cream); }
.prose .updated { color: var(--lavender); font-size: .95rem; }

/* Footer */
.site-footer {
  margin-top: 28px;
  padding: 26px 0 34px;
  border-top: var(--border);
  background: var(--night-deep);
  font-size: .95rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--cream); font-weight: 800; text-decoration: none; }
.site-footer a:hover { color: var(--moon); text-decoration: underline; }
.site-footer .small { margin: 12px 0 0; color: var(--lavender); font-size: .875rem; }

/* 404 + forwarder */
.center-page { text-align: center; padding: 64px 0; }
.center-page .deco-moon { width: 96px; margin: 0 auto 18px; display: block; }
.center-page p { margin: 0 auto 22px; max-width: 40ch; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 560px) {
  .site-header .logo img { height: 36px; }
  .hero .deco-bat { width: 64px; top: 0; }
  .panel { padding: 16px 18px; }
}

/* ---------- Revision 2: fuller pages ---------- */

.hero--split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 860px) { .hero--split { grid-template-columns: 1.1fr .9fr; } }
.hero h1 .hl { color: var(--cream); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* second button: solid violet fill so it reads as a button on the night background (a see-through one melted into it) */
.button--ghost { background: var(--violet); color: var(--cream); }
a.button--ghost:hover { color: var(--moon); }

.badge {
  display: inline-block; font-weight: 900; font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink); background: var(--moon);
  border: 2px solid var(--edge); border-radius: 999px; padding: 2px 10px;
}
.badge--soft { background: var(--lavender); }

/* Tilted phones */
.phones { position: relative; height: 440px; max-width: 420px; margin: 0 auto; width: 100%; }
.phone {
  position: absolute; width: 200px; aspect-ratio: 600 / 1304;
  border: 4px solid var(--ink); border-radius: 30px; box-shadow: var(--shadow-lg);
  overflow: hidden; background: #000;
}
.phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone--back { left: 6%; top: 18px; transform: rotate(-7deg); }
.phone--front { right: 6%; top: 0; transform: rotate(6deg); }
@media (max-width: 480px) {
  .phones { height: 360px; }
  .phone { width: 160px; }
}

/* Promise panels */
.promise { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.promise .panel { position: relative; padding-top: 26px; }
.promise .panel img { position: absolute; right: 14px; top: -22px; width: 56px; height: auto; }
.promise .panel:nth-child(2) img { transform: rotate(-12deg); }
.promise .panel p { margin: 0; color: var(--cream); }

/* App feature card (studio page) */
.app-feature {
  display: grid; gap: 24px; align-items: center;
  background: var(--night-deep); border: var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 26px; overflow: hidden;
}
@media (min-width: 760px) { .app-feature { grid-template-columns: 1fr 220px; padding: 34px 40px; } }
.app-feature .app-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.app-feature .app-head img { width: 84px; height: 84px; border-radius: 20px; border: var(--border); box-shadow: var(--shadow); }
.app-feature h3 { font-size: 2rem; margin: 0 0 4px; }
.app-feature p { color: var(--cream); }
.app-feature ul { margin: 0 0 20px; padding-left: 1.1em; color: var(--cream); }
.app-feature .phone { position: static; width: 100%; max-width: 220px; margin: 0 auto; transform: rotate(4deg); }

/* Feature grid */
.feature-grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.feature-grid .panel p { margin: 0; font-size: .95rem; }

/* Gallery */
.gallery {
  display: grid; gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.gallery figure { margin: 0; min-width: 0; }
.gallery .phone { position: static; width: 100%; box-shadow: var(--shadow); border-radius: 26px; }
.gallery figcaption { text-align: center; font-weight: 800; color: var(--lavender); margin-top: 10px; font-size: .95rem; }
.credit { color: var(--lavender); font-size: .875rem; max-width: 70ch; margin: 20px 0 0; }

/* What leaves your phone */
.leaves { width: 100%; border-collapse: separate; border-spacing: 0; }
.leaves th, .leaves td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 2px solid var(--night); }
.leaves th { color: var(--moon); font-weight: 900; }
.leaves tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.leaves-grid { display: grid; gap: var(--grid-gap); }
.stays ul { list-style: none; margin: 0; padding: 0; }
.stays li { position: relative; padding: 6px 0 6px 30px; color: var(--cream); }
.stays li::before { content: "✓"; position: absolute; left: 0; top: 4px; font-weight: 900; color: var(--moon); }
.leaves td:first-child { font-weight: 900; color: var(--moon); white-space: nowrap; }
.section-intro strong { color: var(--cream); }
.section-intro.section-intro--wide { max-width: none; }
@media (max-width: 600px) {
  .leaves thead { display: none; }
  .leaves tr { display: block; padding: 10px 0; border-bottom: 2px solid var(--night); }
  .leaves td { display: block; border: 0; padding: 2px 6px; }
  .leaves td:first-child { font-weight: 900; color: var(--moon); }
}

/* FAQ */
.faq { display: grid; gap: var(--grid-gap); max-width: 760px; }
.faq details { background: var(--night-deep); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 22px; }
.faq details:hover, .faq details[open] { background: var(--night); }
.faq summary { cursor: pointer; font-weight: 900; font-size: 1.1rem; color: var(--moon); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: none; } /* the ring goes round the whole card (see the focus rule at the top) */
.faq summary::after { content: "+"; float: right; color: var(--lavender); display: inline-block; }
.faq details[open]:not(.is-closing) summary::after { transform: rotate(45deg); }
.faq details.is-closing p { opacity: 0; transition: opacity .12s linear; }
.faq details p { margin: 10px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .faq summary::after { transition: transform .25s ease; }
  /* the answer fades in; the open/close height animation is in the script at the end of moonbite/index.html */
  .faq details[open] p { animation: faq-in .2s ease-out; }
}
@keyframes faq-in { from { opacity: 0; } to { opacity: 1; } }

/* Call to action */
.cta { text-align: center; padding: 34px 22px; }
.cta p { max-width: 46ch; margin: 0 auto 20px; }
.cta .actions { justify-content: center; }

.section-intro { max-width: 56ch; color: var(--lavender); margin: -12px 0 20px; }

/* Hop between the two sites (script: /assets/site-hop.js): a bat flies corner to corner and night follows it across
   the page along a soft diagonal edge. Only transform animates, so the browser can run it smoothly on the GPU. */
.hop-sweep { position: fixed; z-index: 1000; pointer-events: none; will-change: transform; }
/* the band's edge sits at its middle; ~140px of gradient so it reads as a soft dusk line, not a hard cut */
.hop-sweep--behind { background: linear-gradient(90deg, var(--night-deep) calc(50% - 70px), rgba(31, 16, 64, 0) calc(50% + 70px)); }
.hop-sweep--ahead { background: linear-gradient(90deg, rgba(31, 16, 64, 0) calc(50% - 70px), var(--night-deep) calc(50% + 70px)); }
/* arriving: plain night until the script's sweep takes over; if the script never gets that far it lifts anyway */
html.hop-in body::after {
  content: ""; position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background: var(--night-deep); animation: hop-lift .4s ease-in 1.6s forwards;
}
@keyframes hop-lift { to { opacity: 0; } }
.hop-bat { position: fixed; left: 0; top: 0; width: 96px; height: 77px; margin: -38px 0 0 -48px; z-index: 1001; pointer-events: none; overflow: visible; will-change: transform; }
