/* ==========================================================================
   Enhydra Games – site styles
   Measurements follow the original WordPress theme (1400px reference width).
   ========================================================================== */

:root {
  --blue: #5bb3d7;
  --purple: #695087;
  --pink: #e52a6f;
  --brown: #392526;
  --grey: #e5e5e5;

  --text: #000;
  --heading: var(--blue);
  --link: var(--blue);
  --link-hover: var(--purple);
  --surface: #fff;          /* white cards */
  --tile: var(--blue);      /* blue tiles / skills bar */
  --chrome-bg: #fff;        /* header + footer */
  --body-bg: linear-gradient(282deg, #e5e5e5 0%, #fff 100%);
  --hero-bg: linear-gradient(180deg, #f6f6f6 0%, #fff 5%);
  --tagline: var(--purple);
  --role: var(--brown);
  --icon: var(--blue);
  --icon-hover: var(--purple);
  --switch-bg: var(--grey);
  --switch-text: #000;

  --font-body: "Roboto Condensed", sans-serif;
  --font-display: "Bebas Neue", sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: 80.96px;        /* header padding / card inset */
  --content: 1200px;
  --gap: 24px;
  --shadow: 1px 1px 5px 1px rgba(0, 0, 0, 0.2);
}

html.dark {
  --text: #fff;
  --heading: #fff;
  --link: #fff;
  --link-hover: var(--grey);
  --surface: var(--purple);
  --tile: var(--brown);
  --chrome-bg: var(--purple);
  --body-bg: linear-gradient(282deg, #392526, #695087);
  --hero-bg: linear-gradient(0deg, #644f7a 79%, #53435c 100%);
  --tagline: #fff;
  --role: #fff;
  --icon: #fff;
  --icon-hover: var(--grey);
  --switch-bg: var(--brown);
  --switch-text: #fff;
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--body-bg) fixed;
  background-color: var(--grey);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html.dark body { background-color: var(--brown); }

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { margin: 0; color: var(--heading); font-family: var(--font-display); font-weight: 400; }
h1 { font-size: 36px; line-height: 1.15; font-weight: 300; }
h2 { font-size: 32px; line-height: 1.2; }
h3 { font-size: 32px; line-height: 1; font-weight: 300; }

p { margin: 0; }

a {
  color: var(--link);
  font-family: var(--font-display);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25ch;
}
a:hover, a:focus-visible { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

.only-dark { display: none; }
html.dark .only-light { display: none; }
html.dark .only-dark { display: block; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--purple);
  color: #fff;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* Content column: 1200px wide, 100px side margins at 1400px. */
.container {
  width: min(var(--content), 100% - 2 * clamp(16px, 7.15vw, 100px));
  margin: var(--top, 0) auto 0;
}

.text-large { font-size: clamp(21px, 2.6vw, 28px); line-height: 1.5; }
.text-intro { font-size: 20.8px; line-height: 1.5; }

/* Header ----------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  padding: 24px var(--gutter);
  background: var(--chrome-bg);
}

.logo { flex-shrink: 0; padding-right: var(--gutter); }
.logo img { width: 200px; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  font-size: 28px;
  line-height: 42px;
  text-decoration: none;
  color: var(--blue);
  transition: color 0.2s;
}
html.dark .site-nav a { color: #fff; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--purple); }
html.dark .site-nav a:hover { color: var(--grey); }

.nav-toggle, .nav-close {
  display: none;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
}
html.dark .nav-toggle, html.dark .nav-close { color: #fff; }
.nav-toggle svg, .nav-close svg { width: 28px; height: 28px; display: block; }

/* Language switcher */
.lang-switch { position: relative; margin-left: auto; font-family: var(--font-ui); font-size: 14px; font-weight: 400; }
.lang-switch summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 134px;
  height: 55px;
  padding: 0 12px 0 16px;
  border-radius: 5px;
  background: var(--switch-bg);
  color: var(--switch-text);
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { background: #66acc3; }
.lang-switch summary span { flex: 1; }
.lang-switch .chevron { width: 20px; height: 20px; transition: transform 0.2s; }
.lang-switch[open] summary { border-radius: 5px 5px 0 0; }
.lang-switch[open] .chevron { transform: rotate(180deg); }
.lang-switch ul {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  border-radius: 0 0 5px 5px;
  background: var(--switch-bg);
}
.lang-switch li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: var(--switch-text);
  font-family: inherit;
  text-decoration: none;
}
.lang-switch li a:hover { background: #66acc3; color: #000; }
.flag { width: 18px; height: 18px; border-radius: 3px; flex-shrink: 0; }

/* Hero (home) ------------------------------------------------------------ */

.hero { background: var(--hero-bg); }
/* Fixed 320px side padding like the original, so the logo grows with the window. */
.hero-inner {
  display: grid;
  grid-template-columns: 2fr 5fr;
  gap: var(--gap);
  align-items: center;
  padding: 36px min(320px, 22.86vw) 10.72px;
}
.hero-text { display: grid; gap: var(--gap); }
.tagline {
  text-align: right;
  color: var(--tagline);
  font-size: clamp(18px, 3vw, 28px);
  line-height: 1.5;
}

/* Cards & media-text ----------------------------------------------------- */

.card {
  background: var(--surface);
  border-radius: 7px;
}

/* WordPress media-text: image column + text column with 8% side padding. */
.media-text {
  display: grid;
  grid-template-columns: var(--media, 15%) 1fr;
  align-items: center;
  padding: var(--pad, 24px 24px 24px var(--gutter));
}
.media-text > img { width: 100%; }
.media-text > div { padding: 0 8%; display: grid; gap: var(--gap); }

/* Social icons */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 55px;
  color: var(--icon);
  transition: transform 0.2s, color 0.2s;
}
.socials a:hover, .socials a:focus-visible { transform: translateY(-4px); color: var(--icon-hover); }
.socials svg { width: 100%; height: 52px; fill: currentColor; display: block; }
.socials.small a { width: 50px; height: 43px; }
.socials.small svg { height: 40px; }
.home-intro > div { padding-top: 20px; }
.home-intro .socials { margin-top: 47px; }

/* Supported by / Awards */
.logo-cards {
  display: flex;
  gap: var(--gap);
  margin: 118px 0 var(--gap);
}
.logo-card {
  display: grid;
  gap: var(--gap);
  padding: var(--gap);
  border-radius: 7px;
  background: var(--surface);
  text-align: center;
}
.logo-card.supported { flex: 1; }
.logo-card.awards { flex: 0 0 228px; }
.logo-card ul {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.logo-card li { display: flex; justify-content: center; }
.logo-card.supported li:nth-child(2) { justify-content: flex-start; } /* as on the original */
.logo-card img { height: 100px; width: auto; max-width: 100%; box-shadow: var(--shadow); }
.logo-card a { display: block; transition: transform 0.2s; }
.logo-card a:hover { transform: scale(1.1); }

/* Business --------------------------------------------------------------- */

.fields-card {
  display: grid;
  gap: var(--gap);
  padding: 36px;
  text-align: center;
}
.fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.fields li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: var(--gap);
  border-radius: 7px;
  background: var(--tile);
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.5;
  font-weight: 400;
}
.fields-card > p { margin-top: 30px; text-align: left; }

.clients-title { margin-top: 98px; }
.clients-strip { background: #fff; padding: 0 24px; }
.clients-strip .carousel-slide { height: 150px; }
.clients-strip a { display: block; height: 100%; }
.clients-strip { margin-bottom: var(--gap); }
.clients-strip img { width: 100%; max-width: 200px; height: 100%; margin: 0 auto; object-fit: contain; }

/* Carousel --------------------------------------------------------------- */

.carousel { position: relative; --pv: var(--per-view, 1); }
@media (min-width: 768px) {
  .carousel { --pv: var(--per-view-desktop, var(--per-view, 1)); }
}
.carousel-track {
  position: relative;
  display: flex;
  gap: var(--slide-gap, 15px);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 calc((100% - (var(--pv) - 1) * var(--slide-gap, 15px)) / var(--pv));
  scroll-snap-align: start;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #000;
  cursor: pointer;
}
html.dark .carousel-btn { color: #fff; }
.carousel-btn svg { width: 100%; height: 100%; display: block; }
.carousel-btn.prev { left: 61px; }
.carousel-btn.next { right: 61px; }

/* Team ------------------------------------------------------------------- */

.team-banner { width: 100%; height: 250px; object-fit: cover; object-position: left top; }

.team-section { background: var(--surface); padding: 36px 0; }
.member {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  margin: 10px 0;
  padding: 0 110px;
}
.member img { flex: 0 0 200px; width: 200px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.member figcaption { display: grid; gap: var(--gap); }
.member .role { color: var(--role); font-size: 18px; line-height: 1.15; }

.skills-bar {
  margin-top: var(--gap);
  padding: 16px 0;
  border-radius: 7px;
  background: var(--tile);
  text-align: center;
}
.skills-bar h1 { color: #fff; }
.skills { display: grid; gap: var(--gap); margin-top: var(--gap); }
.skill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 250px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface);
}
/* height:0 + min-height:100% keeps the photo from stretching the 250px row */
.skill img { width: 100%; height: 0; min-height: 100%; object-fit: cover; }
.skill.reverse img { order: 2; }
.skill > div { align-self: center; display: grid; gap: var(--gap); padding: 24px 48px; }

/* Jobs / contact / WIP / legal --------------------------------------------- */

.legal h2 { margin-top: var(--gap); }
.legal h2:first-child { margin-top: 0; }
.legal p { margin-top: var(--gap); font-size: clamp(21px, 2.6vw, 28px); line-height: 1.5; }
.legal ul { margin: var(--gap) 0 0; font-size: 18px; line-height: 1.5; }
.legal h2 + p { margin-top: var(--gap); }

/* Footer ----------------------------------------------------------------- */

.site-footer {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 0 var(--gap);
  margin-top: 100px;
  padding: 54.08px 42.75px 16px;
  background: var(--chrome-bg);
}
.footer-center { display: grid; gap: var(--gap); justify-items: center; text-align: center; align-content: start; }
.footer-left, .footer-right { align-self: start; }
.footer-right { text-align: right; }

/* Dark mode toggle --------------------------------------------------------- */

.dark-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99;
  width: 62px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50px;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  transition: background 0.4s;
}
html.dark .dark-toggle { background: var(--blue); }
.dark-toggle svg {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  transition: opacity 0.4s;
}
.dark-toggle .icon-moon { right: 10px; }
.dark-toggle .icon-sun { left: 10px; opacity: 0; }
html.dark .dark-toggle .icon-moon { opacity: 0; }
html.dark .dark-toggle .icon-sun { opacity: 1; }
.dark-toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.4s;
}
html.dark .dark-toggle .knob { transform: translateX(32px); }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .member { padding: 0 70px; }
  .carousel-btn.prev { left: 16px; }
  .carousel-btn.next { right: 16px; }
}

@media (max-width: 900px) {
  .logo-cards { flex-direction: column; }
  .logo-card.awards { flex-basis: auto; }
  .fields { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 781px) {
  .site-footer { grid-template-columns: 1fr; gap: var(--gap); text-align: center; }
  .footer-right { text-align: center; }
}

@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .site-header { gap: 12px; }
  .logo { padding-right: 0; }
  .logo img { width: 150px; }
  .nav-toggle, .nav-close { display: block; }
  .nav-toggle { order: 3; }
  .lang-switch summary { min-width: 0; height: 44px; }
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--chrome-bg);
  }
  .site-nav.open ul { flex-direction: column; align-items: center; gap: 12px; }
  .site-nav.open a { font-size: 40px; line-height: 1.3; }
  .nav-close { position: absolute; top: 24px; right: 16px; }

  .container { --top: 32px !important; }
  .media-text { grid-template-columns: 1fr; gap: var(--gap); --pad: 24px 16px !important; }
  .media-text > img { max-width: 220px; margin: 0 auto; }
  .media-text > div { padding: 0; }
  .socials a { width: 48px; height: 44px; }
  .socials svg { height: 36px; }
  .logo-cards { margin-top: 48px; }
  .logo-card ul { grid-auto-flow: row; }
  .fields-card { padding: 24px 16px; }
  .fields { grid-template-columns: 1fr; }
  .fields li { min-height: 0; }
  .clients-title { margin-top: 48px; }
  .team-banner { height: 180px; object-position: center top; }
  .member { flex-direction: column; padding: 0 56px; text-align: center; }
  .member img { flex-basis: auto; width: 160px; }
  .member h2 { font-size: 28px; }
  .skill { grid-template-columns: 1fr; }
  .skill.reverse img { order: 0; }
  .skill img { aspect-ratio: 12 / 5; height: auto; }
  .skill > div { padding: 24px 16px; }
  .site-footer { margin-top: 64px; padding: 32px 16px 64px; }
}

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