/* style.ejs (served as /style.css) - TeNi Tiny Games I/S website */

/* ---------- Tokens ---------- */
:root {
  --green-950: #071f16;
  --green-900: #0a2e20;
  --green-800: #0d3f2b;
  --green-700: #116142;
  --green-ink: #0f7a43;          /* accessible green for text/links on white */
  --primary: #2ecc71;            /* emerald */
  --mint: #98ff98;               /* mint */
  --mint-soft: #ecfbf1;
  --bg: #ffffff;
  --surface: #f5f8f6;
  --border: #e1e8e4;
  --text: #16201b;
  --muted: #5a6a61;
  --on-dark: #e8f5ee;
  --on-dark-muted: #a9c4b6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(10, 46, 32, .06), 0 1px 3px rgba(10, 46, 32, .08);
  --shadow-md: 0 6px 16px rgba(10, 46, 32, .08), 0 18px 40px rgba(10, 46, 32, .08);

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --content: 1120px;
}

/* Gutter is computed per element so sections can override --content */
main > section, .nav, footer {
  --gutter: max(1.25rem, calc((100% - var(--content)) / 2));
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .6em;
  color: var(--green-950);
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }

p { margin: 0 0 1em; }

a { color: var(--green-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-700); text-decoration-thickness: 2px; }

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

code {
  font-size: .9em;
  background: var(--mint-soft);
  color: var(--green-800);
  padding: .1em .4em;
  border-radius: 6px;
}

main > section { padding: 4.5rem var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--green-950);
  text-decoration: none;
  white-space: nowrap;
}
.brand::before {
  content: "T";
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--green-700));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.brand:hover { color: var(--green-950); text-decoration: none; }

.nav-list {
  list-style: none;
  display: flex;
  gap: .25rem;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: .45rem .9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-list a:hover { background: var(--surface); color: var(--green-950); }
.nav-list a[aria-current="page"] { background: var(--mint-soft); color: var(--green-800); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(4.5rem, 10vw, 7.5rem) !important;
  padding-bottom: clamp(6rem, 12vw, 9rem) !important;
  text-align: center;
  color: var(--on-dark);
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(152, 255, 152, .22), transparent 60%),
    radial-gradient(40rem 24rem at 0% 110%, rgba(46, 204, 113, .28), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-800) 55%, var(--green-700));
}
.hero::after {
  /* subtle dotted grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  color: #fff;
  max-width: 16ch;
  margin: 0 auto 1.25rem;
  font-size: clamp(2.4rem, 6vw, 4.25rem);
}
.hero p {
  max-width: 38rem;
  margin: 0 auto 2.25rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--on-dark-muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .95rem 1.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-950);
  font: 700 1.05rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(152, 255, 152, .25);
  transition: transform .15s, box-shadow .15s;
}
.cta::after { content: "→"; transition: transform .15s; }
.cta:hover { color: var(--green-950); text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(152, 255, 152, .35); }
.cta:hover::after { transform: translateX(3px); }

/* ---------- Fact strip ---------- */
.facts { padding-top: 0 !important; padding-bottom: 0 !important; margin-top: -3rem; position: relative; z-index: 2; }
.facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.facts li {
  padding: 1.4rem 1.5rem;
  font-weight: 600;
  color: var(--green-950);
  border-right: 1px solid var(--border);
}
.facts li:last-child { border-right: 0; }
.facts li::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .6rem;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: middle;
}

/* ---------- Section headings (home) ---------- */
.widget > h2,
.services-cards > h2,
.faq > h2 { text-align: center; }
.widget > h2::after,
.services-cards > h2::after,
.faq > h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin: .9rem auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--mint));
}

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .95rem; color: var(--green-950); margin-bottom: .4rem; }

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: .8rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #c5d3cb; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, .18);
}
textarea { resize: vertical; min-height: 9rem; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - .8rem) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

form button[type="submit"] {
  padding: .85rem 1.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--green-800);
  color: #fff;
  font: 700 1rem var(--font-body);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
form button[type="submit"]:hover { background: var(--green-700); transform: translateY(-1px); }

.form-success {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1rem;
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
  border: 1px solid #bfeccd;
  color: var(--green-800);
  font-weight: 600;
}
.form-success::before {
  content: "✓";
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .9rem;
}

/* ---------- Quote widget ---------- */
.widget { background: var(--surface); margin-top: 4.5rem; }
#quote-form {
  max-width: 860px;
  margin: 2.5rem auto 0;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: .4rem 1rem;
}
#quote-form label[for="genre"] { margin-top: .8rem; }
#quote-form button { margin-top: 1rem; }
#quote-result, .widget > .form-success { max-width: 860px; margin-inline: auto; }

@media (min-width: 760px) {
  #quote-form {
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas: "l1 l2 ." "i1 i2 btn";
    align-items: end;
  }
  #quote-form label[for="game-title"] { grid-area: l1; }
  #quote-form #game-title { grid-area: i1; }
  #quote-form label[for="genre"] { grid-area: l2; margin-top: 0; }
  #quote-form #genre { grid-area: i2; }
  #quote-form button { grid-area: btn; margin-top: 0; height: 100%; }
}

/* ---------- Service cards (home) ---------- */
.services-cards .cards {
  counter-reset: card;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.card {
  counter-increment: card;
  position: relative;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card::before {
  content: "0" counter(card);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: var(--mint-soft);
  color: var(--green-ink);
  font: 800 1rem var(--font-display);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cfe9d8; }
.card h3 { margin-bottom: .4rem; }
.card p { margin: 0; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { --content: 780px; padding-top: 1rem !important; }
.faq > h2 { margin-bottom: 2.25rem; }
.faq details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  transition: border-color .15s, box-shadow .15s;
}
.faq details[open] { border-color: #bfeccd; box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  font-weight: 700;
  color: var(--green-950);
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--surface);
  color: var(--green-ink);
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform .2s, background .2s;
}
.faq details[open] summary::after { content: "−"; background: var(--mint-soft); }
.faq details p { margin: 0; padding: 0 1.35rem 1.25rem; color: var(--muted); }

/* ---------- Inner page header band ---------- */
.about,
.policy,
.tos,
.services-detail,
.contact-section {
  background: linear-gradient(180deg, var(--mint-soft), #fff 18rem);
}
.about > h1,
.policy > h1,
.tos > h1,
.services-detail > h1,
.contact-section > h1 { margin-bottom: .5rem; }

/* ---------- About / policy / terms (reading column) ---------- */
.about, .policy, .tos { --content: 760px; }
.about h2, .policy h2, .tos h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.about > p:first-of-type { font-size: 1.2rem; color: var(--muted); }
.policy > h1 + p, .tos > h1 + p {
  display: inline-block;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.policy ul, .tos ul { padding-left: 1.25rem; }
.policy li, .tos li { margin-bottom: .5rem; }
.policy li::marker, .tos li::marker { color: var(--primary); }

/* ---------- Services page ---------- */
.service-list {
  counter-reset: svc;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.service-list li {
  counter-increment: svc;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.service-list li:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.service-list li::before {
  content: "0" counter(svc);
  display: block;
  margin-bottom: 1rem;
  font: 800 .9rem var(--font-display);
  letter-spacing: .08em;
  color: var(--primary);
}
.service-list h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.service-list p { margin: 0; color: var(--muted); }

/* ---------- Contact page ---------- */
.contact-section {
  display: grid;
  gap: 0 2.5rem;
  grid-template-columns: 1fr;
}
.contact-section > p { color: var(--muted); font-size: 1.15rem; margin-bottom: 2.5rem; }
#contact-form {
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
#contact-form label { margin-top: 1rem; }
#contact-form label:first-of-type { margin-top: 0; }
.privacy-consent { display: flex; align-items: flex-start; gap: .6rem; margin: 1.25rem 0 1.5rem; }
.privacy-consent input { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--green-700); flex: none; }
.privacy-consent label { margin: 0 !important; font-weight: 500; color: var(--muted); }
#contact-form button { align-self: flex-start; }

.contact-details {
  margin-top: 1.5rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  color: var(--on-dark);
  background:
    radial-gradient(24rem 16rem at 100% 0%, rgba(152, 255, 152, .18), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-700));
  align-self: start;
}
.contact-details p { margin: 0; padding: .9rem 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.contact-details p:last-child { border-bottom: 0; }
.contact-details strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mint); }
.contact-details a { color: #fff; }

@media (min-width: 900px) {
  .contact-section { grid-template-columns: 1.5fr 1fr; }
  .contact-section > h1, .contact-section > p { grid-column: 1 / -1; }
  .contact-details { margin-top: 0; }
}

/* ---------- 404 ---------- */
main.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem;
  background: linear-gradient(180deg, var(--mint-soft), #fff);
}
main.centered h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
main.centered p { color: var(--muted); }
main.centered p:last-child a {
  display: inline-block;
  margin-top: 1rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  background: var(--green-800);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
main.centered p:last-child a:hover { background: var(--green-700); }

/* ---------- Footer ---------- */
footer {
  display: grid;
  gap: 2rem;
  padding: 3.5rem var(--gutter) 2rem;
  background: var(--green-950);
  color: var(--on-dark-muted);
  font-size: .95rem;
}
footer a { color: var(--on-dark); text-decoration: none; }
footer a:hover { color: var(--mint); text-decoration: underline; }
.footer-main p { margin: 0 0 .3rem; }
.footer-main strong {
  display: block;
  margin-bottom: .6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fff;
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: .55rem 2.5rem;
}
.footer-copy {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem;
}

@media (min-width: 760px) {
  footer { grid-template-columns: 1fr auto; }
  .footer-copy { grid-column: 1 / -1; }
}

/* ---------- Cookie banner ---------- */
#cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2000;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(7, 31, 22, .25);
  font-size: .95rem;
  animation: banner-in .35s ease-out;
}
#cookie-banner p { margin: 0; color: var(--muted); }
#cookie-banner p strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--green-950); }
#cookie-banner > div:not(#cookie-settings) { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
#cookie-banner button {
  padding: .6rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--green-950);
  font: 600 .9rem var(--font-body);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
#cookie-banner button:hover { border-color: var(--green-700); background: var(--surface); }
#cookie-banner #btn-accept { background: var(--green-800); border-color: var(--green-800); color: #fff; margin-left: auto; }
#cookie-banner #btn-accept:hover { background: var(--green-700); }
#cookie-settings { padding-top: .75rem; border-top: 1px solid var(--border); }
#cookie-settings label { display: flex; gap: .5rem; align-items: center; font-weight: 500; margin-bottom: .75rem; }

@keyframes banner-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  main > section { padding-top: 3.25rem; padding-bottom: 3.25rem; }
  .nav { flex-wrap: wrap; padding-top: .7rem; padding-bottom: .5rem; }
  .nav-list { width: 100%; overflow-x: auto; margin: 0 -.5rem; scrollbar-width: none; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-list a { padding: .4rem .75rem; }
  .facts li { border-right: 0; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
  .facts li:last-child { border-bottom: 0; }
  #quote-form, #contact-form, .card, .service-list li, .contact-details { padding: 1.5rem; }
  #cookie-banner #btn-accept { margin-left: 0; }
}

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