/* =============================================
   TIME AND TIME STUDIO — Global Styles
   style.css
   ============================================= */

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream:      #f7f1e3;
  --cream-dark: #ede6d3;
  --cream-mid:  #f2ead8;
  --orange:     #f4a261;
  --orange-deep:#e07b39;
  --ink:        #1a1208;
  --ink-soft:   #3d2e1a;
  --ink-muted:  #7a6652;
  --white:      #ffffff;
  --card-bg:    #fdf8ef;
  --border:     #ddd0b8;

  --font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius: 6px;
  --radius-lg: 12px;
  --transition: 0.22s ease;

  --max-w: 1100px;
  --nav-h: 64px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

/* --- LAYOUT HELPERS --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section--sm {
  padding: 48px 0;
}

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--cream);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.nav__logo {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.2;
}

.nav__logo span {
  color: var(--orange);
}

.nav__links {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav__links a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color var(--transition);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--ink);
  border-bottom-color: var(--orange);
}

/* Hamburger */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile nav */
.nav__mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--cream);
  border-bottom: 1.5px solid var(--border);
  padding: 24px;
  z-index: 99;
  flex-direction: column;
  gap: 20px;
}

.nav__mobile.open {
  display: flex;
}

.nav__mobile a {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color var(--transition);
}

.nav__mobile a:hover,
.nav__mobile a.active {
  color: var(--orange);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              transform var(--transition), border-color var(--transition);
}

.btn--primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

.btn--primary:hover {
  background: var(--orange-deep);
  border-color: var(--orange-deep);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}

.btn--outline:hover {
  background: var(--orange);
  color: var(--white);
  transform: translateY(-2px);
}

.btn--dark {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn--dark:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  transform: translateY(-2px);
}

/* =============================================
   IMAGE PLACEHOLDERS
   ============================================= */
.placeholder {
  background: var(--cream-dark);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  gap: 8px;
  border-radius: var(--radius);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 48px 0 32px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer__brand-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--orange);
}

.footer__tagline {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.footer__heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  font-size: 0.85rem;
  color: var(--ink-muted);
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--cream);
}

.footer__bottom {
  border-top: 1px solid #2e2212;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__copy {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.footer__copy span {
  color: var(--orange);
}

/* =============================================
   ===  PAGE: INDEX (HOMEPAGE)  ===
   ============================================= */

/* HERO */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  /* Dot-grid signature texture */
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  background-color: var(--cream);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 60px 24px;
}

.hero__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}

.hero__title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 24px;
}

.hero__title em {
  font-style: normal;
  color: var(--orange);
}

.hero__desc {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 440px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__visual {
  width: 100%;
  aspect-ratio: 4/3;
}

/* ABOUT STRIP */
.about-strip {
  background: var(--ink);
  padding: 64px 0;
}

.about-strip__inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: center;
}

.about-strip__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
}

.about-strip__heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 16px;
  line-height: 1.3;
}

.about-strip__text {
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.7;
}

/* FEATURED GAMES */
.featured__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* =============================================
   GAME CARDS (shared: homepage + games page)
   ============================================= */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.game-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(26,18,8,0.12);
}

.game-card__banner {
  width: 100%;
  aspect-ratio: 16/9;
}

.game-card__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-card__studio {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}

.game-card__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.game-card__desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 20px;
}

.game-card__footer {
  display: flex;
  gap: 12px;
}

.game-card__footer .btn {
  width: 100%;
  text-align: center;
}

/* =============================================
   ===  PAGE: GAMES  ===
   ============================================= */
.page-banner {
  background: var(--ink);
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(244,162,97,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.page-banner__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.page-banner__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--cream);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.page-banner__desc {
  font-size: 1rem;
  color: var(--ink-muted);
  max-width: 560px;
  line-height: 1.65;
}

/* =============================================
   ===  PAGE: GAME DETAIL  ===
   ============================================= */
.game-hero {
  position: relative;
  background: var(--ink);
  overflow: hidden;
}

.game-hero__banner {
  width: 100%;
  aspect-ratio: 21/8;
  opacity: 0.7;
}

.game-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--ink) 30%, transparent 80%);
  display: flex;
  align-items: flex-end;
}

.game-hero__content {
  padding: 40px 24px;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.game-hero__logo-box {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  border: 3px solid var(--orange);
  overflow: hidden;
}

.game-hero__title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.game-hero__studio {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
}

/* Game body */
.game-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}

.game-desc-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.game-desc-text {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 24px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.features-list li::before {
  content: '◆';
  color: var(--orange);
  font-size: 0.6rem;
  margin-top: 5px;
  flex-shrink: 0;
}

/* Sidebar */
.game-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.game-sidebar__card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.game-sidebar__logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  margin: 0 auto 16px;
  border: 2px solid var(--border);
  overflow: hidden;
}

.game-sidebar__title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.game-sidebar__by {
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.game-sidebar__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.game-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.game-meta-row__label {
  color: var(--ink-muted);
  font-weight: 600;
}

.game-meta-row__value {
  color: var(--ink);
  font-weight: 700;
}

.game-sidebar__dl {
  margin-top: 24px;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
}

/* Screenshots */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.screenshot-item {
  aspect-ratio: 16/10;
  border-radius: var(--radius);
  overflow: hidden;
}


/* =============================================
   RESPONSIVE — Multi-screen coverage
   Breakpoints:
     1280px+ : Large desktop / widescreen
     1024px  : Small desktop / large tablet landscape
     900px   : Tablet landscape
     768px   : Tablet portrait
     600px   : Large phone / small tablet
     480px   : Phone portrait
     360px   : Small phone
   ============================================= */

/* ── Large desktop (1280px+) ───────────────── */
@media (min-width: 1280px) {
  :root { --max-w: 1180px; }

  .hero__title { font-size: 4.4rem; }
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .screenshots-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Small desktop / large tablet landscape (≤1024px) ── */
@media (max-width: 1024px) {
  :root { --max-w: 960px; }

  .hero__inner { gap: 40px; }
  .hero__title { font-size: clamp(2rem, 4vw, 3.2rem); }
  .game-body { gap: 40px; }
  .about-strip__inner { gap: 40px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ── Tablet landscape (≤900px) ─────────────── */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
    padding: 48px 24px;
  }
  .hero__desc { max-width: 100%; }
  .hero__actions { justify-content: center; }
  .hero__visual {
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 16/10;
  }

  .about-strip__inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .game-body { grid-template-columns: 1fr; }
  .game-sidebar { position: static; }

  .footer__inner { grid-template-columns: 1fr; gap: 32px; }

  .page-banner { padding: 52px 0 40px; }
  .page-banner__title { font-size: clamp(1.7rem, 4vw, 2.4rem); }

  .game-hero__banner { aspect-ratio: 16/7; }
}

/* ── Tablet portrait (≤768px) ──────────────── */
@media (max-width: 768px) {
  :root { --nav-h: 58px; }

  .section { padding: 60px 0; }
  .section--sm { padding: 40px 0; }
  .container { padding: 0 20px; }

  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__logo { font-size: 0.7rem; }

  .hero { min-height: calc(100svh - var(--nav-h)); }
  .hero__inner { padding: 40px 20px; gap: 32px; }
  .hero__title { font-size: clamp(1.9rem, 6vw, 2.8rem); }
  .hero__desc { font-size: 0.95rem; }
  .hero__visual { max-width: 420px; }

  .about-strip { padding: 48px 0; }
  .about-strip__heading { font-size: 1.35rem; }

  .featured__header { margin-bottom: 32px; }

  .screenshots-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .game-hero__banner { aspect-ratio: 4/3; }
  .game-hero__logo-box { width: 88px; height: 88px; }
  .game-hero__title { font-size: clamp(1.7rem, 5vw, 2.6rem); }
  .game-hero__content { padding: 28px 20px; }

  .footer { padding: 40px 0 28px; }
}

/* ── Large phone (≤600px) ──────────────────── */
@media (max-width: 600px) {
  .container { padding: 0 16px; }

  .hero__inner { padding: 32px 16px; }
  .hero__title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .hero__actions { flex-direction: column; align-items: center; gap: 12px; }
  .hero__actions .btn { width: 100%; max-width: 280px; text-align: center; }

  .games-grid { grid-template-columns: 1fr; gap: 20px; }

  .game-card__footer { flex-direction: column; gap: 10px; }
  .game-card__footer .btn { width: 100%; text-align: center; }

  .page-banner { padding: 40px 0 32px; }

  .screenshots-grid { grid-template-columns: 1fr; gap: 14px; }
  .screenshot-item { aspect-ratio: 16/9; }

  .game-sidebar__card { padding: 20px; }

  .footer__inner { gap: 28px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── Phone portrait (≤480px) ───────────────── */
@media (max-width: 480px) {
  :root { --nav-h: 54px; }

  .nav__logo { font-size: 0.65rem; letter-spacing: 0.16em; }
  .nav__inner { padding: 0 16px; }

  .section { padding: 48px 0; }
  .hero { background-size: 20px 20px; }
  .hero__title { font-size: clamp(1.5rem, 8vw, 2rem); }
  .hero__desc { font-size: 0.9rem; }

  .about-strip__heading { font-size: 1.2rem; }
  .about-strip__text { font-size: 0.88rem; }

  .section-title { font-size: clamp(1.3rem, 5vw, 1.7rem); }

  .btn { font-size: 0.76rem; padding: 11px 22px; }

  .game-hero__banner { aspect-ratio: 1/1; }
  .game-hero__logo-box { width: 72px; height: 72px; }
  .game-hero__title { font-size: clamp(1.4rem, 6vw, 2rem); }

  .game-desc-heading { font-size: 1.1rem; }
  .game-desc-text { font-size: 0.88rem; }
  .features-list li { font-size: 0.86rem; }

  .page-banner__title { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .page-banner__desc { font-size: 0.88rem; }
}

/* ── Small phone (≤360px) ──────────────────── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .hero__title { font-size: 1.4rem; }
  .hero__desc { font-size: 0.85rem; }
  .nav__logo { font-size: 0.6rem; }
  .game-card__body { padding: 18px; }
  .game-card__title { font-size: 1.05rem; }
}

/* =============================================
   LANGUAGE TOGGLE — Minimal text switch
   ============================================= */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}

.lang-toggle:focus-visible .lang-toggle__option--active {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

.lang-toggle__option {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  user-select: none;
  line-height: 1;
}

.lang-toggle__option--active {
  color: var(--ink);
  border-bottom-color: var(--orange);
}

.lang-toggle__option:not(.lang-toggle__option--active):hover {
  color: var(--ink-soft);
}

/* Divider between EN and TH */
.lang-toggle__divider {
  width: 1px;
  height: 10px;
  background: var(--border);
  margin: 0 7px;
  flex-shrink: 0;
}

/* Hide slider — not used in minimal mode */
.lang-toggle__slider { display: none; }

.nav__mobile .lang-toggle {
  align-self: flex-start;
}

.nav__mobile .lang-toggle .lang-toggle__option {
  font-size: 0.82rem;
}

/* =============================================
   UTILITY
   ============================================= */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-orange { color: var(--orange); }

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