/* ==========================================================================
   Meltpoint Studios shared styles
   Used by meltpointstudios.com and testers.meltpointstudios.com.
   Mobile first: base rules are for phones, @media blocks add bigger screens.
   ========================================================================== */

/* 1. Colours, fonts and sizes. Change these to change the whole site. */
:root {
  --cellar: #1E1710;        /* page background */
  --cellar-deep: #140F0A;   /* header and footer */
  --cellar-warm: #2B2117;   /* alternate section bands, inputs */
  --cheese: #FFC629;        /* main accent: buttons, highlights */
  --cheese-light: #FFD75E;
  --rind: #E08A00;          /* darker accent: borders, hover */
  --rind-dark: #B86F00;
  --wax: #FFF3C9;           /* text on dark */
  --wax-dim: #D9C9A3;       /* quieter text */
  --vein: #5B7FD1;          /* tiny accent: links, focus rings */
  --vein-light: #9DB4F0;
  --line: #4A3A28;          /* subtle borders */

  --font-heading: "Rubik", "Arial Black", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;          /* longest comfortable line of text */
  --wrap: 1120px;           /* page width on big screens */
  --gutter: 1rem;
  --radius: 14px;
  --drip-height: clamp(60px, 5vw, 96px);
  --melt-run: 110px;        /* how far the hero drip travels */
}

/* 2. Reset and base text */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--cellar); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
  color: var(--wax); background: var(--cellar);
}
main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3 {
  font-family: var(--font-heading); font-weight: 800; line-height: 1.08;
  letter-spacing: -0.015em; margin: 0 0 0.5em; text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 1.3rem + 4vw, 4rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p, ul, ol, dl { margin: 0 0 1em; max-width: var(--measure); }
.lead { font-size: 1.2rem; color: var(--wax-dim); }
.meta { color: var(--wax-dim); font-size: 0.95rem; }
a {
  color: inherit; text-decoration: underline; text-decoration-color: var(--vein);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
a:hover { color: var(--vein-light); text-decoration-color: var(--vein-light); }
code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.95em;
  background: var(--cellar-deep); padding: 0.1em 0.4em; border-radius: 6px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--vein); outline-offset: 3px; }

/* 3. Layout helpers */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.band { padding: 3rem 0; }
.band--warm { background: var(--cellar-warm); }
.band--deep { background: var(--cellar-deep); }
.page-head { padding: 2.5rem 0 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.25rem 0; }
.skip-link {
  position: absolute; top: -100px; left: 1rem; z-index: 20; padding: 0.6rem 1rem;
  background: var(--cheese); color: var(--cellar); font-weight: 700;
  text-decoration: none; border-radius: 0 0 10px 10px;
}
.skip-link:focus { top: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.notice {
  border-left: 4px solid var(--vein); background: var(--cellar-warm);
  padding: 0.75rem 1rem; border-radius: 0 10px 10px 0;
}
.alert {
  border-left: 4px solid var(--rind); background: var(--cellar-warm);
  padding: 0.75rem 1rem; border-radius: 0 10px 10px 0; font-weight: 500;
}

/* 4. Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.65rem 1.35rem; border-radius: 12px;
  border: 0; border-bottom: 4px solid var(--rind);
  background: var(--cheese); color: var(--cellar);
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--rind); border-bottom-color: var(--rind-dark); color: var(--cellar); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn--ghost { background: transparent; color: var(--wax); border: 2px solid var(--line); }
.btn--ghost:hover { background: transparent; border-color: var(--cheese); color: var(--wax); }
.btn--small { min-height: 40px; padding: 0.4rem 1rem; font-size: 0.95rem; border-bottom-width: 3px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.soon { color: var(--wax-dim); font-weight: 500; }

/* 5. Header and navigation */
.site-header { background: var(--cellar-deep); padding: 0.75rem 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-right: auto;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem; text-decoration: none;
}
.brand:hover { color: var(--cheese); }
.brand .logo { width: 36px; height: 36px; flex: none; }
.header-note { margin: 0; color: var(--wax-dim); font-weight: 500; }
.nav-toggle {
  min-height: 44px; padding: 0.5rem 0.9rem; border: 2px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--wax); font: inherit; font-weight: 700; cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { border-color: var(--cheese); }
.site-nav { display: none; flex-basis: 100%; }
.site-nav[data-open="true"] { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0.5rem 0 0.25rem; display: flex; flex-direction: column; gap: 0.25rem; max-width: none; }
.site-nav a:not(.btn) { display: block; padding: 0.55rem 0.25rem; text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--cheese); }
.site-nav a[aria-current="page"] { color: var(--cheese); text-decoration: underline; text-decoration-color: var(--cheese); }
.site-nav .btn { margin-top: 0.5rem; }
@media (min-width: 48em) {
  .nav-toggle { display: none; }
  .site-nav { display: block; flex-basis: auto; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 0.25rem 1.1rem; padding: 0; }
  .site-nav .btn { margin: 0; }
}
@media (scripting: none) {
  .nav-toggle { display: none; }
  .site-nav { display: block; }
}

/* 6. Hero with the melting cheese */
.hero { padding-top: 2.5rem; }
.hero .wrap { display: grid; gap: 2rem; }
.hero .lead { margin-top: 0.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-cheese { position: relative; width: min(62vw, 280px); margin: 0 auto; padding-bottom: var(--melt-run); }
.hero-cheese .cheese { display: block; width: 100%; height: auto; }
.melt { position: absolute; left: 36%; bottom: 0; width: 24px; height: var(--melt-run); margin-left: -12px; pointer-events: none; }
.melt::before {
  /* a little sag where the drip leaves the block */
  content: ""; position: absolute; top: -4px; left: -5px; width: 34px; height: 14px;
  background: var(--cheese); border-radius: 0 0 17px 17px;
}
.melt-trail {
  position: absolute; top: 0; left: 5px; right: 5px; height: 100%;
  background: var(--cheese); border-radius: 0 0 7px 7px; transform-origin: top center;
  animation: melt-trail 1.9s cubic-bezier(0.5, 0, 0.75, 0.6) 0.6s both;
}
.melt-drop {
  position: absolute; left: 0; bottom: -2px; width: 24px; height: 26px;
  background: var(--cheese); border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
  animation: melt-drop 1.9s cubic-bezier(0.5, 0, 0.75, 0.6) 0.6s both;
}
@keyframes melt-trail { from { transform: scaleY(0.03); } to { transform: scaleY(1); } }
@keyframes melt-drop { from { transform: translateY(calc(26px - var(--melt-run))); } to { transform: translateY(0); } }
@media (min-width: 48em) {
  .hero .wrap { grid-template-columns: 1.25fr 1fr; align-items: end; gap: 3rem; }
  .hero-copy { padding-bottom: 3rem; }
  .hero-cheese { width: min(100%, 340px); }
}

/* 7. Drip divider between sections. Colour = section above, background = section below. */
.drip { display: block; width: 100%; height: var(--drip-height); line-height: 0; overflow: hidden; }
.drip svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.drip--cheese { color: var(--cheese); }
.drip--cellar { color: var(--cellar); }
.drip--warm { color: var(--cellar-warm); }
.drip--deep { color: var(--cellar-deep); }
.drip--on-warm { background: var(--cellar-warm); }
.drip--on-deep { background: var(--cellar-deep); }
.drip--on-cellar { background: var(--cellar); }

/* 8. Status tags, placeholders, game cards */
.tag {
  display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; border: 2px solid currentColor;
  font-size: 0.85rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.tag--live { background: var(--cheese); border-color: var(--cheese); color: var(--cellar); }
.tag--playtest { color: var(--vein-light); }
.tag--development { color: var(--rind); }
.status-key { margin-top: 2rem; line-height: 2.1; }
.placeholder {
  display: grid; place-items: center; aspect-ratio: 16 / 9; margin: 0; padding: 1rem;
  border: 2px dashed var(--line); border-radius: var(--radius); text-align: center;
  color: var(--wax-dim); font-weight: 500;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 198, 41, 0.05) 14px 28px);
}
.media-grid { display: grid; gap: 1rem; }
@media (min-width: 40em) {
  .media-grid { grid-template-columns: repeat(3, 1fr); }
  .media-grid .placeholder--wide { grid-column: 1 / -1; }
}
.game-grid {
  list-style: none; margin: 0; padding: 0; max-width: none; display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.game-card { display: grid; gap: 0.6rem; align-content: start; }
.game-card h2 { font-size: 1.5rem; margin: 0; }
.game-card p { margin: 0; }
.featured { display: grid; gap: 1.25rem; }
.featured h3 { font-size: 1.75rem; margin: 0.25rem 0 0.5rem; }
@media (min-width: 48em) {
  .featured { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 2.5rem; }
}

/* 9. Devlog and long text */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.post-list h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.post-list p { margin-bottom: 0.5rem; }
.post-date { color: var(--wax-dim); font-size: 0.95rem; }
.post-teaser h3 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.5em; }
.prose li { margin-bottom: 0.35em; }
.prose img { border-radius: var(--radius); }
.team { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.team li { padding: 1rem 1.25rem; border: 2px solid var(--line); border-radius: var(--radius); }
.team .handle { display: block; font-family: var(--font-heading); font-size: 1.15rem; color: var(--cheese); }
.contact-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }

/* 10. Footer */
.site-footer { background: var(--cellar-deep); padding: 2.5rem 0 2rem; font-size: 0.95rem; color: var(--wax-dim); }
.site-footer .wrap { display: grid; gap: 1.25rem; }
.footer-links { list-style: none; margin: 0; padding: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer-links a { text-decoration: none; padding: 0.25rem 0; display: inline-block; }
.footer-links a:hover { color: var(--wax); text-decoration: underline; }
.legal { margin: 0; max-width: none; }

/* 11. Forms (testers site) */
.step { padding: 2rem 0 3rem; }
.form-section { border: 0; padding: 0; margin: 0 0 2.5rem; min-width: 0; }
.form-section > legend { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; padding: 0; margin-bottom: 1rem; }
.field { margin: 0 0 1.4rem; max-width: var(--measure); border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend, .field > .label { display: block; font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.hint { display: block; font-size: 0.92rem; color: var(--wax-dim); margin-bottom: 0.5rem; }
.optional, .required { font-weight: 400; color: var(--wax-dim); }
.static-value { font-size: 1.1rem; font-weight: 700; margin: 0; }
input[type="text"], input[type="url"], select, textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.85rem;
  font: inherit; color: var(--wax); background: var(--cellar-deep);
  border: 2px solid var(--line); border-radius: 10px;
}
input::placeholder, textarea::placeholder { color: #8f7f5f; }
textarea { min-height: 7.5rem; resize: vertical; }
select {
  appearance: none; padding-right: 2.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%23FFF3C9' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--vein); outline-offset: 2px; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice { position: relative; display: inline-block; }
.choice input { position: absolute; top: 50%; left: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; }
.choice span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  padding: 0.5rem 1rem; border: 2px solid var(--line); border-radius: 999px;
  font-weight: 600; cursor: pointer; background: var(--cellar-deep);
}
.choice span:hover { border-color: var(--rind); }
.choice input:checked + span { background: var(--cheese); border-color: var(--cheese); color: var(--cellar); }
.choice input:focus-visible + span { outline: 3px solid var(--vein); outline-offset: 3px; }
.choices--rating .choice span { padding: 0.5rem 0.25rem; min-width: 48px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-footer { max-width: var(--measure); }

/* 12. Less motion for people who ask for it */
@media (prefers-reduced-motion: reduce) {
  .melt-trail, .melt-drop { animation: none !important; transform: none !important; }
  .btn:active { transform: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
