/* Saena Games website — colours from design-guide.md */
:root {
  --cream: #f8f3e5;
  --paper: #fffaf0;
  --pine: #203d31;
  --pine-soft: #3d5a4c;
  --sage: #93ab78;
  --sage-light: #e4ead6;
  --turquoise: #84c9c4;
  --yellow: #ecc779;
  --line: #dedbca;
  --coral: #e77b59;
  --radius: 22px;
  --wrap: 1240px;
  --gutter: clamp(16px, 5vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--pine);
  font: 17px/1.6 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0 0 .6em; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; }
h3 { font-size: 1.45rem; line-height: 1.2; font-weight: 800; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--pine-soft); max-width: 36ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; color: var(--sage); margin-bottom: .5em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--pine); color: var(--cream); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Header */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand img { width: 200px; }
.nav { display: flex; gap: clamp(14px, 2.4vw, 30px); }
.nav a { text-decoration: none; font-weight: 800; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--sage); }

.nav a.lang { border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.nav a.lang:hover { border-color: var(--sage); background: var(--sage-light); }

/* Chinese pages: Chinese system fonts (Google Fonts is blocked in mainland China), no tight letter spacing */
html:lang(zh-Hans) body { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif; }
html:lang(zh-Hans) h1, html:lang(zh-Hans) h2, html:lang(zh-Hans) h3 { letter-spacing: 0; }
html:lang(zh-Hans) .eyebrow { letter-spacing: .08em; }
html:lang(zh-Hans) .lead { max-width: 30em; }
.trailer-note { margin: 12px 0 0; color: var(--pine-soft); font-size: .95rem; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: .5em;
  background: var(--pine); color: var(--cream); text-decoration: none;
  padding: .75em 1.25em; border-radius: 999px; font-weight: 800; border: 2px solid var(--pine);
  transition: transform .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-2px); background: #2c5242; }
.button.light { background: transparent; color: var(--pine); }
.button.light:hover { background: var(--sage-light); }
.button svg { width: 1.15em; height: 1.15em; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* Home hero */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; background: #f9efda; }
.hero img { width: 100%; aspect-ratio: 1920 / 800; object-fit: cover; }
.hero .intro { position: absolute; left: 5%; top: 50%; transform: translateY(-50%); width: 41%; }
.hero h1 { font-size: clamp(2.4rem, 4.4vw, 4.2rem); }
.hero .intro .lead { margin-bottom: 1.4em; }

/* Sections */
section { margin-top: clamp(56px, 8vw, 96px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head p { margin: 0; color: var(--pine-soft); max-width: 46ch; }

/* Game cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card > a img { width: 100%; aspect-ratio: 7 / 4; object-fit: cover; transition: transform .4s ease; }
.card > a { overflow: hidden; display: block; }
.card > a:hover img { transform: scale(1.03); }
.card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .body p { color: var(--pine-soft); }
.card h3 small { display: block; font-size: .85rem; font-weight: 700; color: var(--pine-soft); letter-spacing: 0; margin-top: 2px; }
.card .buttons { margin-top: auto; padding-top: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.tags li { background: var(--sage-light); border-radius: 999px; padding: 3px 12px; font-size: .85rem; font-weight: 700; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.about img { border-radius: var(--radius); }
.about p { color: var(--pine-soft); }

/* Contact */
.contact { background: var(--pine); color: var(--cream); border-radius: var(--radius); padding: clamp(28px, 5vw, 56px); }
.contact h2 { color: var(--cream); }
.contact .eyebrow { color: var(--yellow); }
.contact > p { color: #d7dfcf; max-width: 50ch; }
.mails { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.mails a { display: block; text-decoration: none; background: rgba(248, 243, 229, .08); border: 1px solid rgba(248, 243, 229, .18); border-radius: 16px; padding: 16px 18px; transition: background .15s ease; }
.mails a:hover { background: rgba(248, 243, 229, .16); }
.mails strong { display: block; font-size: 1.05rem; }
.mails span { display: block; color: #c9d3c0; font-size: .9rem; overflow-wrap: anywhere; }

/* Social links */
.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 42px; height: 42px; border-radius: 999px; background: var(--sage-light); color: var(--pine); text-decoration: none; transition: transform .15s ease, background .15s ease; }
.social a:hover { transform: translateY(-2px); background: var(--sage); color: var(--cream); }
.social svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.follow-title { color: var(--cream); font-size: 1.1rem; margin: 30px 0 12px; }
.social.pills a { width: auto; height: auto; padding: 10px 16px; background: rgba(248, 243, 229, .08); border: 1px solid rgba(248, 243, 229, .18); color: var(--cream); font-weight: 800; }
.social.pills a:hover { background: rgba(248, 243, 229, .18); color: var(--cream); }

/* Game page */
.game-hero { position: relative; border-radius: var(--radius); overflow: hidden; }
.game-hero picture img { width: 100%; aspect-ratio: 1920 / 900; object-fit: cover; }
.game-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14, 30, 23, .72) 0%, rgba(14, 30, 23, .1) 45%, transparent 70%); }
.game-hero .title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(18px, 4vw, 44px); display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.game-hero .title h1 { margin: 0; }
.game-hero .logo { width: clamp(180px, 26vw, 340px); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.game-hero .button { background: var(--cream); color: var(--pine); border-color: var(--cream); }
.game-hero .button:hover { background: #fff; }
.game-intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.game-intro .lead { max-width: none; }
.facts { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; text-align: right; color: var(--pine-soft); }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 0; list-style: none; }
.features li { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.features h3 { font-size: 1.15rem; margin-bottom: .35em; }
.features p { margin: 0; color: var(--pine-soft); font-size: .97rem; }
.features .icon { font-size: 1.6rem; line-height: 1; margin-bottom: 10px; display: block; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.shots a { display: block; border-radius: 14px; overflow: hidden; background: var(--sage-light); }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .35s ease; }
.shots a:hover img { transform: scale(1.04); }
.cta { text-align: center; background: var(--sage-light); border-radius: var(--radius); padding: clamp(32px, 6vw, 64px) var(--gutter); }
.cta .lead { margin: 0 auto 1.4em; }
.cta .buttons { justify-content: center; }
.theme-lv .cta { background: #dff0ee; }
.theme-lv .features li { border-top: 4px solid var(--turquoise); }
.theme-wm .features li { border-top: 4px solid var(--yellow); }

/* Trailer: a picture with a play button; the YouTube player only loads when clicked */
.trailer { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; text-decoration: none; }
.trailer img, .trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.trailer .play { position: absolute; left: 50%; top: 50%; width: clamp(64px, 9vw, 96px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 999px; background: rgba(248, 243, 229, .95); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); transition: transform .15s ease; }
.trailer .play::after { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent var(--pine); }
.trailer:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.trailer-label { position: absolute; left: 16px; bottom: 14px; background: rgba(14, 30, 23, .75); color: var(--cream); font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: .95rem; }

/* Screenshot viewer */
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: min(1600px, 94vw); }
dialog.viewer::backdrop { background: rgba(10, 20, 15, .86); }
dialog.viewer img { border-radius: 12px; max-height: 86vh; width: auto; }
dialog.viewer button { position: fixed; top: 14px; right: 16px; background: var(--cream); color: var(--pine); border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 1.4rem; font-weight: 800; cursor: pointer; }

/* Footer */
.site-footer { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid #cdd4bc; padding: 28px 0 40px; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer img { width: 220px; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 700; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer small { display: block; width: 100%; color: var(--pine-soft); }

/* Not found */
.notfound { text-align: center; padding: 60px 0 20px; }
.notfound .lead { margin: 0 auto 1.4em; }

/* Narrow screens */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-intro { grid-template-columns: 1fr; }
}
/* Below laptop width the home text no longer fits beside the art: put it under the picture */
@media (max-width: 1100px) {
  .hero { display: flex; flex-direction: column; }
  .hero img { aspect-ratio: 2 / 1; object-position: right center; }
  .hero .intro { position: static; transform: none; width: auto; padding: 28px clamp(20px, 4vw, 40px) 30px; }
  .hero .lead { max-width: 48ch; }
}
@media (max-width: 820px) {
  .brand img { width: 150px; }
  .hero img { aspect-ratio: 1000 / 850; }
  .cards, .about { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { flex-direction: column; align-items: start; }
  .game-hero picture img { aspect-ratio: 960 / 900; }
}
/* Game pages on tablets and phones: logo and button go below the picture instead of covering it */
@media (max-width: 1000px) {
  .game-hero { background: var(--pine); }
  .game-hero::after { display: none; }
  .game-hero .title { position: static; padding: 18px 20px 22px; align-items: center; }
  .game-hero .logo { width: min(240px, 60vw); filter: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  /* Phones: logo on top, menu as one full-width row under it */
  .site-header { padding: 16px 0 6px; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 10px; }
  .nav { width: 100%; justify-content: space-between; align-items: center; gap: 8px; }
  .nav a { font-size: .95rem; }
  .features, .mails { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .facts dd { text-align: left; }
  .facts div { flex-direction: column; gap: 2px; }
  .game-hero .title { flex-direction: column; align-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
