/* Octin Games, стиль «Роща»: хвоя, мох, песок, солнце, небо. Шрифты свои, ничего внешнего. */
@font-face { font-family: 'Yeseva One'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/yeseva-one-latin.woff2') format('woff2'); }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/golos-text-latin.woff2') format('woff2'); }

:root {
  --pine: #17302a;
  --pine-deep: #10241e;
  --night: #0c201c;
  --moss: #234238;
  --moss-hi: #2c5247;
  --sand: #e9dfc6;
  --sand-2: rgba(233, 223, 198, .74);
  --sand-3: rgba(233, 223, 198, .5);
  --sun: #f2b33d;
  --sun-hi: #ffc75a;
  --sky: #9cc9e0;
  --line: rgba(233, 223, 198, .13);
  --display: 'Yeseva One', Georgia, 'Times New Roman', serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--pine);
  color: var(--sand);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.08; letter-spacing: .005em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 72px; }

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

/* ---------- шапка ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding: 14px 0;
  transition: background-color .3s, border-color .3s, padding .3s;
  border-bottom: 1px solid transparent;
}
.top.scrolled {
  background: rgba(16, 36, 30, .86);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom-color: var(--line);
  padding: 9px 0;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 38px; height: 38px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.brand:hover .mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-family: var(--display); font-size: 21px; letter-spacing: .01em; white-space: nowrap; }
.nav { display: flex; gap: clamp(12px, 3vw, 30px); }
.nav a {
  text-decoration: none; font-size: 15px; font-weight: 500; color: var(--sand-2);
  padding: 6px 0; position: relative; white-space: nowrap;
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--sun); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav a:hover, .nav a.active { color: var(--sand); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

/* ---------- первый экран: лес ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: max(620px, min(100svh, 940px));
  display: flex; align-items: flex-start;
  background: linear-gradient(#0c201c, #17302a 38%, #2b5148 58%, #8a8a5c 66%, #142a23 70%);
  isolation: isolate;
}
.scene { position: absolute; inset: 0; z-index: -1; }
.layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; will-change: transform; }
.hero::after {
  /* стык леса со страницей */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; z-index: -1;
  background: linear-gradient(to bottom, rgba(23,48,42,0), var(--pine));
}
.stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--sand); opacity: .2;
  animation: twinkle var(--d, 4s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.15); } }
.flies i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #ffd77a;
  box-shadow: 0 0 6px 2px rgba(242,179,61,.75), 0 0 18px 6px rgba(242,179,61,.25);
  opacity: 0;
  animation: fly var(--d, 9s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes fly {
  0%   { opacity: 0; transform: translate(0, 0); }
  15%  { opacity: .95; }
  35%  { opacity: .25; }
  50%  { opacity: .9; transform: translate(var(--dx, 30px), var(--dy, -40px)); }
  70%  { opacity: .3; }
  85%  { opacity: .85; }
  100% { opacity: 0; transform: translate(calc(var(--dx, 30px) * -.4), calc(var(--dy, -40px) * 1.6)); }
}
@media (prefers-reduced-motion: reduce) {
  .stars i, .flies i { animation: none; }
  .flies i { opacity: .6; }
}

.hero-inner { position: relative; padding-top: clamp(110px, 17vh, 190px); padding-bottom: 80px; }
.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sky);
  margin-bottom: 18px;
}
.kicker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 12px rgba(242,179,61,.8); }
.hero h1 {
  font-size: clamp(44px, 8.2vw, 98px);
  text-shadow: 0 4px 30px rgba(5, 16, 12, .55);
  max-width: 12ch;
}
.lead {
  margin-top: 22px; max-width: 34em;
  font-size: clamp(17px, 1.9vw, 20px); color: var(--sand-2);
  text-shadow: 0 2px 16px rgba(5, 16, 12, .7);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  font: 600 16px/1 var(--body); letter-spacing: .01em; text-decoration: none;
  transition: transform .2s, background-color .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn-sun { background: var(--sun); color: #1a2c22; box-shadow: 0 8px 24px -8px rgba(242,179,61,.6); }
.btn-sun:hover { background: var(--sun-hi); transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(242,179,61,.75); }
.btn-ghost { border: 1.5px solid rgba(233,223,198,.35); color: var(--sand); background: rgba(12,32,28,.35); }
.btn-ghost:hover { border-color: var(--sand); transform: translateY(-2px); }
.yt { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ---------- разделы ---------- */
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section-head { margin-bottom: 36px; max-width: 40em; }
.section-head h2 { font-size: clamp(36px, 5.4vw, 60px); }
.section-head p { margin-top: 12px; color: var(--sand-2); }
.section-head .btn { margin-top: 26px; }

/* карточка игры */
.game {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  background: linear-gradient(160deg, var(--moss-hi), var(--moss) 55%);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  overflow: hidden; text-decoration: none;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.55);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s;
}
.game:hover { transform: translateY(-4px); border-color: rgba(242,179,61,.45); box-shadow: 0 40px 70px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(242,179,61,.2); }
.game-art { position: relative; overflow: hidden; background: #0d0d0b; min-height: 340px; }
.game-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 18% 50%; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.game:hover .game-art img { transform: scale(1.045); }
.play-badge {
  position: absolute; right: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: rgba(12, 22, 18, .72); color: var(--sand);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 600 14px/1 var(--body); letter-spacing: .04em; text-transform: uppercase;
  transform: translateY(8px); opacity: 0; transition: opacity .3s, transform .3s;
}
.play-badge svg { width: 18px; height: 18px; fill: var(--sun); }
.game:hover .play-badge, .game:focus-visible .play-badge { opacity: 1; transform: none; }
.game-body { padding: clamp(24px, 3.4vw, 44px); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sun); }
.game h3 { font-size: clamp(34px, 4.2vw, 50px); margin-top: 10px; }
.game-body > p:not(.eyebrow) { margin-top: 14px; color: var(--sand-2); font-size: 16px; }
.chips { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 999px;
  background: rgba(156, 201, 224, .1); color: var(--sky); border: 1px solid rgba(156, 201, 224, .22);
}
.game-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 28px; }
.game:hover .game-cta .btn-sun { background: var(--sun-hi); }
.on-cg { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--sand-3); }
.on-cg img { height: 30px; width: auto; }

/* следующая игра */
.soon {
  display: flex; align-items: center; gap: 20px;
  margin-top: 22px; padding: 22px clamp(20px, 3vw, 32px);
  border: 1.5px dashed rgba(233,223,198,.22); border-radius: var(--radius);
  color: var(--sand-2);
}
.sapling { width: 46px; height: 46px; flex: none; fill: var(--moss-hi); }
.sapling rect { fill: var(--moss-hi); }
.soon h3 { font-size: 24px; color: var(--sand); }
.soon p { margin-top: 4px; font-size: 15px; }

/* журнал разработки */
.section-log { background: var(--pine-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.log-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.log-grid .section-head { margin-bottom: 0; position: sticky; top: 100px; }
.log { list-style: none; margin: 0; padding: 0; position: relative; }
.log::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--sun), rgba(242,179,61,.05)); border-radius: 2px; }
.log li { position: relative; padding: 0 0 36px 40px; }
.log li:last-child { padding-bottom: 0; }
.log li::before {
  content: ''; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--pine-deep); border: 3px solid var(--sun);
}
.log li:first-child::before { background: var(--sun); box-shadow: 0 0 0 6px rgba(242,179,61,.15); }
.log time { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.log h3 { font-size: clamp(22px, 2.4vw, 28px); margin-top: 6px; }
.log p { margin-top: 8px; color: var(--sand-2); font-size: 16px; }

/* контакты */
.section-contact { position: relative; overflow: hidden; text-align: center; }
.section-contact::before {
  content: ''; position: absolute; left: 50%; bottom: -200px; width: 760px; height: 600px; margin-left: -380px; z-index: -1;
  border-radius: 50%; background: radial-gradient(circle, rgba(242,179,61,.22), rgba(242,179,61,0) 65%);
  pointer-events: none;
}
.section-contact { isolation: isolate; padding-bottom: clamp(150px, 16vw, 200px); }
.section-contact::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 130px; z-index: -1; pointer-events: none;
  background: url('img/treeline.svg') center bottom / 1600px 130px repeat-x;
}
.contact h2 { font-size: clamp(40px, 6vw, 68px); }
.contact > p { margin-top: 12px; color: var(--sand-2); }
.mail {
  display: inline-block; margin-top: 26px;
  font-family: var(--display); font-size: clamp(26px, 5.4vw, 52px); line-height: 1.15;
  text-decoration: none; color: var(--sun);
  background: linear-gradient(var(--sun), var(--sun)) left bottom / 0 3px no-repeat;
  transition: background-size .35s; overflow-wrap: anywhere;
}
.mail:hover { background-size: 100% 3px; }
.contact-links { list-style: none; padding: 0; margin: 30px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 26px; }
.contact-links a { display: inline-flex; align-items: center; gap: 9px; color: var(--sand-2); text-decoration: none; font-weight: 500; }
.contact-links a:hover { color: var(--sand); }

/* подвал */
.foot { background: var(--pine-deep); padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--sand-3); }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.fine { font-size: 13px; }

/* ---------- телефон ---------- */
@media (max-width: 1100px) {
  .game { grid-template-columns: 1fr; }
  .game-art { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 900px) {
  .play-badge { opacity: 1; transform: none; }
  .log-grid { grid-template-columns: 1fr; }
  .log-grid .section-head { position: static; margin-bottom: 8px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .brand-name { font-size: 18px; }
  .mark { width: 32px; height: 32px; }
  .nav a { font-size: 14px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .soon { align-items: flex-start; }
  .sapling { width: 36px; height: 36px; }
}
@media (max-width: 370px) {
  .brand-name { font-size: 16px; }
  .nav { gap: 10px; }
  .nav a { font-size: 13px; }
}
