:root {
  --bg: #000;
  --text: #fff;
  --muted: #555;
  --header-h: 96px;

  /* Accent colours (Mosaik-inspired test) */
  --mint: #89c5b0;
  --beige: #e8dcc4;
  --blue: #206fb8;
  --yellow: #e0be12;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h); /* menu links don't land under the header */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Header ---------- */
/* No bar – Home, the helmet and the menu float at the top: Home to the left, the helmet
   in the middle, the menu to the right */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding-top: 60px; /* Home and the menu sit at the same height on every page */
  pointer-events: none; /* only the boxes and the helmet catch clicks, not the empty strip */
}

.site-header > * { pointer-events: auto; }

/* Home, the menu (About, Projects and Contact share one box) and the menu button sit in
   see-through boxes like the VENDEL STUDIOS frame – with tighter, harder corners */
.home-link,
.site-nav,
.menu-toggle {
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid #000;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.home-link,
.site-nav a {
  padding: 10px 18px;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.home-link {
  justify-self: start;
  color: var(--mint);
  transition: border-color 0.2s ease;
}

/* Home's box lights up in its colour on hover and when you're on the start page */
.home-link:hover,
.home-link[aria-current] { border-color: currentColor; }

/* Inside the shared menu box: underline in the word's colour on hover and for the
   page/section you're on */
.site-nav a {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current] { text-decoration-color: currentColor; }

/* The helmet – always takes you back home. It slips away once you scroll down */
.brand {
  justify-self: center;
  display: block;
  transform-origin: 50% 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.brand img {
  display: block;
  height: 64px;
  width: auto;
  transition: transform 0.2s ease;
}

.brand:hover img { transform: scale(1.06); }
.brand:active img { transform: scale(0.97); }

.site-header.scrolled .brand {
  opacity: 0;
  transform: translateY(-16px) scale(0.7);
  pointer-events: none;
}

/* Start page: a much bigger helmet hanging over the artwork – placed on its own, so it
   doesn't push Home and the menu down */
.has-hero .brand {
  position: absolute;
  top: 14px;
  /* centred with auto margins, not a -50% shift – that shift goes wrong on phones while
     the intro changes the helmet's size, and the helmet slides off to the side */
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
}

.has-hero .brand img { height: 150px; }

/* Menu */
.site-nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  padding: 0 4px;
}

.nav-about    { color: var(--beige); }
.nav-projects { color: var(--mint); }
.nav-contact  { color: var(--blue); }

/* Hamburger button – only shown on small screens */
.menu-toggle {
  display: none;
  justify-self: end;
  width: 48px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.menu-toggle span:nth-child(1) { top: 13px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-toggle span:nth-child(3) { top: 27px; }

.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  :root { --header-h: 76px; }

  .site-header { padding: 34px 16px 0; }
  .brand img { height: 50px; }
  .has-hero .brand { top: 10px; }
  .has-hero .brand img { height: 100px; }
  .menu-toggle { display: block; grid-column: 3; grid-row: 1; }

  .home-link,
  .site-nav a { padding: 9px 14px; font-size: 0.9rem; }

  /* The menu opens as one box under the button, the items stacked.
     Nearly solid here, so it stays readable over whatever is under it */
  .site-nav {
    position: absolute;
    top: calc(var(--header-h) + 8px);
    right: 16px;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 4px;
    background: rgba(0, 0, 0, 0.88);
    display: none;
  }

  .menu-open .site-nav { display: flex; }

  .site-nav a { font-size: 1rem; }
}

/* ---------- Home: artwork with the name in a frame ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* The artwork is a little taller than the hero so it can drift as you scroll (main.js) */
.hero-bg {
  position: absolute;
  inset: -12% 0;
  background: url("bilder/hero-abstrakt.jpg") center / cover no-repeat;
  transform: translate3d(0, var(--parallax, 0px), 0);
  will-change: transform;
}

/* See-through frame with rounded corners holding the name – always VENDEL STUDIOS on one
   line, same size. The text is ~6.2em wide in Anton, so 12.4vw keeps it on one line on phones */
.hero-frame {
  position: relative;
  max-width: 92vw;
  padding: 1.3em 0.6em;
  font-size: clamp(36px, 12.4vw, 96px);
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid #000;
  border-radius: 20px;
  color: var(--mint);
  text-align: center;
}

.hero-frame h1 {
  margin: 0;
  font-family: "Anton", Impact, "Arial Narrow", sans-serif;
  font-size: 1em;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Animated snow and wind drawn over the backgrounds (main.js: startWeather) */
.weather {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Abstract page backgrounds + see-through frames (About, Contact) ---------- */
/* The background stays put behind the page and drifts a touch as you scroll (main.js) */
.page-bg {
  position: fixed;
  inset: -8% 0;
  z-index: -1;
  background: center / cover no-repeat;
  transform: translate3d(0, var(--parallax, 0px), 0);
  will-change: transform;
}

.bg-blue  .page-bg { background-image: url("bilder/bakgrund-bla.jpg"); }

/* Contact: the blue background a little darker */
.bg-blue .page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.bg-white .page-bg { background-image: url("bilder/bakgrund-vit.jpg"); }

/* Same see-through, rounded frame as VENDEL STUDIOS on the start page */
.panel {
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid #000;
  border-radius: 20px;
  padding: clamp(28px, 6vw, 56px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* On the white background: a light, slightly mint see-through frame with black text */
.bg-white .panel {
  background: rgba(137, 197, 176, 0.22);
  color: #111;
}

/* Home and the menu are inverted here: light see-through boxes, and darker shades of
   the menu colours so the words stay readable on the light background */
.bg-white .home-link,
.bg-white .site-nav,
.bg-white .menu-toggle { background: rgba(255, 255, 255, 0.5); }

.bg-white .home-link,
.bg-white .nav-projects { color: #2c6b57; }
.bg-white .nav-about    { color: #7a6438; }
.bg-white .nav-contact  { color: #1a5c9a; }

.bg-white .menu-toggle span { background: #111; }

@media (max-width: 760px) {
  .bg-white .site-nav { background: rgba(255, 255, 255, 0.92); }
}

.bg-white .panel h1,
.bg-white .panel h2,
.bg-white .panel strong,
.bg-white .people li { color: #111; }
.bg-white .panel p { color: #222; }
.bg-white .panel .todo-note { color: #666; }
.bg-white .panel .divider { background: rgba(0, 0, 0, 0.35); }

.bg-white .panel .button {
  border-color: #111;
  color: #111;
}

.bg-white .panel .button:hover {
  background: #111;
  color: #fff;
}

/* ---------- Projects ---------- */
/* Full-width area on a mint version of the abstract background */
.projects-area {
  position: relative;
  background: url("bilder/bakgrund-mint.jpg") center / cover no-repeat;
}

.projects-area .projects { position: relative; } /* above the snow */

.projects {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 40px;
}

.section-title {
  margin: 0 0 80px;
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Big Anton headings in the Projects area, like VENDEL STUDIOS on the start page */
.projects .section-title,
.project-head h3 {
  font-family: "Anton", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
}

.projects .section-title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: 0.04em;
}

/* Each project sits in a see-through frame, like VENDEL STUDIOS */
.project {
  padding: clamp(32px, 6vw, 64px);
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid #000;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project + .project { margin-top: 48px; }

.project-head {
  margin-bottom: 36px;
  text-align: center;
}

/* Small label above the title: where the project is at */
.project-status {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 2px solid var(--yellow);
  border-radius: 6px;
  color: var(--yellow);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Trailer: just a small link with a line of text under it */
.trailer {
  margin: 0 0 72px;
  text-align: center;
}

.trailer-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.play-icon {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.play-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
}

.trailer-link:hover .play-icon { background: rgba(255, 255, 255, 0.12); }

.trailer p {
  margin: 12px 0 0;
  color: #9a9a9a;
  font-size: 0.95rem;
  line-height: 1.6;
}

.project-head h3 {
  margin: 0 0 20px;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mint);
}

/* What kind of game it is – one small label per feature */
.project-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.project-tags li {
  padding: 7px 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid #000;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Zig-zag: image left / text right, then swapped on every other row */
.showcase {
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Screenshots with rounded corners, no border */
.showcase-row img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
  border-radius: 12px;
}

.showcase-row:nth-child(even) img { order: 2; }

.showcase-text p {
  margin: 0;
  padding-top: 8px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #cfcfcf;
}

@media (max-width: 760px) {
  .projects { padding: 80px 16px; }
  .section-title { margin-bottom: 48px; }
  .project { padding: 28px 16px 36px; }
  .project-tags li { font-size: 0.75rem; padding: 6px 10px; }
  .trailer { margin-bottom: 48px; }

  /* Phones: image on top, text below, every row */
  .showcase { gap: 48px; }
  .showcase-row { grid-template-columns: 1fr; gap: 16px; }
  .showcase-row:nth-child(even) img { order: 0; }
}

/* ---------- Contact page ---------- */
.contact-page {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: calc(var(--header-h) + 80px) 24px 120px;
}

.contact-page .section-title { margin-bottom: 48px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.field label {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9a9a9a;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.6;
  text-align: left;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
}

.contact-form .button {
  align-self: center;
  margin-top: 8px;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Honeypot spam trap – never shown */
.hidden-field { display: none; }

.contact-alt {
  margin: 48px 0 0;
  text-align: center;
  color: #9a9a9a;
  line-height: 1.8;
}

.contact-email {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #555;
  overflow-wrap: anywhere;
  transition: border-color 0.2s ease;
}

.contact-email:hover { border-color: var(--text); }

@media (max-width: 760px) {
  .contact-page { padding: calc(var(--header-h) + 48px) 16px 80px; }
  .contact-page .section-title { margin-bottom: 32px; }
  .contact-form .button { align-self: stretch; }
}

/* ---------- About page ---------- */
.about {
  padding: calc(var(--header-h) + 60px) 24px 120px;
  text-align: center;
}

.about-block {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 0;
}

.about .panel {
  max-width: 760px;
  margin: 0 auto;
}

/* No extra space against the frame's top and bottom edges */
.about .panel > .about-block:first-child { padding-top: 0; }
.about .panel > .about-block:last-child  { padding-bottom: 0; }

.about h1,
.about h2 {
  margin: 0 0 32px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.about h1 { font-size: clamp(2.2rem, 7vw, 4.2rem); }
.about h2 { font-size: clamp(1.6rem, 4.5vw, 2.6rem); }

.about p {
  margin: 0 0 16px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #cfcfcf;
}

.divider {
  width: 64px;
  height: 1px;
  margin: 0 auto;
  border: 0;
  background: #333;
}

/* Plain text block at the top of About – left-aligned for easy reading */
.about-text { text-align: left; }
.about-text h1 { text-align: center; }
.about-text strong { color: var(--text); }

/* Temporary reminder text – remove when the real text is in */
.about .todo-note {
  color: #777;
  font-style: italic;
}

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 48px;
}

.people li {
  font-size: 1.15rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  padding: 16px 36px;
  border: 1px solid var(--text);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover,
.contact-form .button:hover {
  background: var(--text);
  color: var(--bg);
}

@media (max-width: 760px) {
  .about { padding-top: calc(var(--header-h) + 24px); padding-inline: 16px; }
  .about-block { padding: 56px 0; }
  .people { gap: 16px 32px; }
}

/* ---------- Footer ---------- */
/* The helmet in the middle, small links to every page under it, then the copyright */
.site-footer {
  position: relative;
  padding: 56px 24px 40px;
  background: #0d0d0d;
  border-top: 1px solid #1f1f1f;
  text-align: center;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 24px;
}

.footer-logo img {
  display: block;
  height: 72px;
  width: auto;
  transition: transform 0.2s ease;
}

.footer-logo:hover img { transform: scale(1.06); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 18px;
}

.footer-links a {
  color: #bdbdbd;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--text); }

.site-footer p {
  margin: 0;
  color: #777;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* ---------- Reveal animations ---------- */
/* Only hide things when JS is running (html.js), so text never goes missing */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Screenshots wipe in from their own side as they scroll into view, like a curtain
   pulled away: left-hand images from the left, right-hand images from the right */
.js .wipe {
  clip-path: inset(0 100% 0 0 round 12px);
  transition: clip-path 1.1s cubic-bezier(0.7, 0, 0.2, 1);
}

.js .showcase-row:nth-child(even) .wipe { clip-path: inset(0 0 0 100% round 12px); }

.js .wipe.is-visible,
.js .showcase-row:nth-child(even) .wipe.is-visible { clip-path: inset(0 0 0 0 round 12px); }

/* Phones: every image is on the left, so they all come in from the left */
@media (max-width: 760px) {
  .js .showcase-row:nth-child(even) .wipe:not(.is-visible) { clip-path: inset(0 100% 0 0 round 12px); }
}

/* Start page: the framed name rises in when the page loads */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.js .hero-frame {
  animation: rise-in 0.9s ease 0.2s both;
}

/* Respect "reduce motion" – show everything straight away, artwork stays still */
@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .wipe,
  .js .showcase-row:nth-child(even) .wipe,
  .js .hero-frame {
    clip-path: none;
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .hero-bg { transform: none; }
}

/* ---------- Start page intro ---------- */
/* Before the first paint: black screen. main.js then brings in the white helmet, sweeps a
   light over it (yellow), opens the background in a circle, settles the helmet at the top,
   and VENDEL STUDIOS and the menu follow */
.intro .brand,
.intro .home-link,
.intro .site-nav,
.intro .menu-toggle,
.intro .hero-frame {
  opacity: 0;
}

.intro .hero { visibility: hidden; } /* main.js takes over with the circle opening */

/* VENDEL STUDIOS rises in just as the helmet lands */
.intro-run .hero-frame { animation-delay: 1.05s; }

/* White copy of the helmet laid over the yellow one during the intro
   (specific enough to beat .has-hero .brand img, so it follows the helmet's size) */
.has-hero .brand img.intro-white {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
}

/* The light sweeping over the helmet, cut to the helmet's shape */
.intro-shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: url("bilder/logo-gul.png") center / 100% 100% no-repeat;
  mask: url("bilder/logo-gul.png") center / 100% 100% no-repeat;
  pointer-events: none;
}

.intro-shine span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 252, 230, 0.95) 50%, transparent 100%);
}

/* Phones: no frosted-glass blur behind the boxes – it has to be redrawn on every scroll
   frame, which makes the page stutter. The backgrounds are soft already, so it looks the same */
@media (max-width: 760px) {
  .home-link,
  .site-nav,
  .menu-toggle,
  .panel,
  .project {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Phones: the helmet sits in the start-page artwork and scrolls away with it (main.js) */
.brand.in-hero { z-index: 3; }
