/* ===== Narat Website — Custom Styles ===== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* CSS Variables */
:root {
  --brand: #5b27f1;
  --brand-hover: #6c3df4;
  --bg-light: #f5f5f7;
  --bg-white: #ffffff;
  --text-dark: #0f172a;
  --text-medium: #475569;
  --text-muted: #999999;
  --footer-bg: #000000;
  --nav-height: 4.6rem;
  --input-bg: #e0e0e9;
  --input-text: #9797a2;
  --input-placeholder: #8b8b9d;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid #1e293b;
  height: var(--nav-height);
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo img {
  height: 2.25rem;
  object-fit: contain;
  transition: transform 0.2s;
}

.nav-logo:hover img {
  transform: scale(1.1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  color: white;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: var(--brand-hover);
}

.nav-links a.active {
  background: white;
  color: var(--brand);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(255,255,255,0.1);
}

.mobile-menu-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: var(--brand);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  color: white;
  transition: background 0.2s;
}

.mobile-menu a:hover {
  background: var(--brand-hover);
}

.mobile-menu a.active {
  background: white;
  color: var(--brand);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .nav {
    height: auto;
  }
  .nav-container {
    min-height: var(--nav-height);
    flex-wrap: wrap;
  }
  .mobile-menu {
    width: 100%;
  }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  height: 800px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: white;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.5) 50%, transparent);
  z-index: 10;
}

.hero-content {
  position: relative;
  z-index: 20;
  padding: 2rem;
  padding-bottom: 5rem;
  max-width: 56rem;
}

.hero h1 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 4.5rem;
  color: white;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero p {
  font-size: 1.25rem;
  color: #e2e8f0;
  margin-bottom: 2rem;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-hover);
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-hero:hover {
  background: var(--brand);
  transform: scale(1.05);
}

.btn-hero svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (min-width: 768px) {
  .hero p {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 600px;
  }
  .hero h1 {
    font-size: 3.75rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-content {
    padding-bottom: 3rem;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: scale(1.05);
}

.btn-primary {
  background: var(--brand-hover);
  color: white;
}

.btn-primary:hover {
  background: var(--brand);
}

.btn-white {
  background: white;
  color: var(--brand);
}

.btn-white:hover {
  background: #f1f5f9;
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.btn-outline:hover {
  background: var(--brand);
  color: white;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

/* ===== Sections ===== */
.section {
  padding: 5rem 1rem;
}

.section-white {
  background: var(--bg-white);
}

.section-light {
  background: var(--bg-light);
}

.section-purple {
  background: var(--brand);
  color: white;
}

.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header-left {
  text-align: left;
  margin-bottom: 2rem;
}

.section-label {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 13.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.section-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 45px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.section-title .highlight {
  color: var(--brand);
}

.section-desc {
  color: var(--text-medium);
  max-width: 48rem;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .section {
    padding: 3rem 1rem;
  }
  .section-title {
    font-size: 36px;
  }
}

/* ===== Two Column Layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 1rem;
}

.about-character-wrap {
  display: flex;
  justify-content: center;
}

@media (min-width: 1024px) {
  .about-character-wrap {
    justify-content: flex-end;
  }
}

.about-text h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.about-text p {
  color: #334155;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.about-text p strong {
  color: var(--text-dark);
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--bg-light);
  color: var(--text-medium);
  transition: background 0.2s, color 0.2s;
}

.social-link:hover {
  background: var(--brand);
  color: white;
}

/* ===== Game Cards (Home Page) ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

.game-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: white;
  transition: transform 0.5s, box-shadow 0.5s;
  cursor: pointer;
}

.game-card:hover {
  transform: scale(1.05);
}

.game-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.game-card img.game-card-img {
  transition: filter 0.3s, transform 0.5s;
}

.game-card:hover img.game-card-img {
  filter: blur(4px);
}

.game-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
  padding: 2rem;
}

.game-card:hover .game-card-overlay {
  opacity: 1;
}

.store-badges {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
  max-width: 200px;
}

.store-badges a {
  display: block;
  width: 100%;
  max-width: 200px;
  transition: transform 0.2s;
}

.store-badges a:hover {
  transform: scale(1.05);
}

.store-badge {
  width: 100%;
  height: auto;
}

/* ===== Game Cards (Games Page) ===== */
.games-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  .games-page-grid {
    grid-template-columns: 1fr;
  }
}

.game-detail-card {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.3s;
}

.game-detail-image {
  flex-shrink: 0;
  border-radius: 1rem;
  overflow: hidden;
}

.game-detail-image img {
  width: 280px;
  height: auto;
  object-fit: contain;
  border-radius: 1rem;
}

.game-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-badge {
  display: inline-block;
  background: var(--brand);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: 0.375rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  width: fit-content;
}

.game-detail-info h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 2rem;
}

.game-detail-info p {
  color: var(--text-medium);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 20rem;
}

.game-detail-info .store-badges {
  margin-top: auto;
  flex-direction: column;
  align-items: flex-start;
  max-width: 180px;
}

.game-detail-info .store-badge {
  height: auto;
  width: 100%;
}

@media (max-width: 640px) {
  .game-detail-card {
    flex-direction: column;
  }
  .game-detail-image {
    width: 100%;
    text-align: center;
  }
  .game-detail-image img {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

.section-desc-left {
  color: var(--text-medium);
  max-width: 48rem;
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 0;
}

/* ===== CTA Section ===== */
.cta-card {
  background: var(--brand);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  margin: 0 auto;
}

.cta-card h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 2.25rem;
  color: white;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.cta-card p {
  color: #e2e8f0;
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.cta-card .btn {
  border-radius: 0.5rem;
  padding: 1rem 2rem;
}

@media (max-width: 768px) {
  .cta-card {
    padding: 3rem 1.5rem;
  }
  .cta-card h2 {
    font-size: 1.75rem;
  }
}

/* ===== Stats Section ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.stat-icon svg {
  width: 2rem;
  height: 2rem;
}

.stat-value {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  color: var(--brand);
}

.stat-label {
  color: rgba(91,39,241,0.8);
  font-size: 0.9rem;
}

/* ===== Contact Section ===== */
.contact-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .contact-header {
    grid-template-columns: 1fr;
  }
  .contact-header-image {
    order: -1;
    max-width: 300px;
    margin: 0 auto;
  }
}

.contact-header-image {
  display: flex;
  justify-content: center;
}

@media (min-width: 1024px) {
  .contact-header-image {
    justify-content: flex-end;
  }
}

.contact-header-image img {
  max-width: 100%;
  height: auto;
}

.contact-emails {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-email-item h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.contact-email-item p {
  font-size: 1rem;
  color: var(--text-dark);
}

.contact-email-item a {
  color: inherit;
  transition: color 0.2s;
}

.contact-email-item a:hover {
  color: var(--brand);
}

/* Contact Form */
.contact-form-wrap {
  max-width: 42rem;
}

.contact-form-wrap h2 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

.contact-form-wrap > p {
  color: #757581;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #757581;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1rem;
  font-family: inherit;
  transition: box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--input-placeholder);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
}

.form-group textarea {
  min-height: 120px;
  resize: none;
}

.form-submit {
  width: 100%;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--brand);
  color: white;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}

.form-submit:hover {
  transform: scale(1.05);
}

/* Success message */
.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
  background: rgba(20, 83, 45, 0.2);
  border: 1px solid #22c55e;
  border-radius: 0.75rem;
}

.form-success.show {
  display: block;
}

.form-success .checkmark {
  width: 4rem;
  height: 4rem;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.form-success .checkmark svg {
  color: white;
  width: 2rem;
  height: 2rem;
}

.form-success h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.form-success p {
  color: var(--text-medium);
}

/* ===== Footer ===== */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid #1e293b;
  padding: 3rem 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: 80rem;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand img {
  height: 2.25rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: #94a3b8;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-legal h4 {
  color: white;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-col h4 {
  color: white;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-legal-links {
  color: #94a3b8;
  font-size: 0.875rem;
}

.footer-legal-links a {
  color: #94a3b8;
  transition: color 0.2s;
}

.footer-legal-links a:hover {
  color: #c084fc;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul a {
  color: #94a3b8;
  transition: color 0.2s;
}

.footer-col ul a:hover {
  color: #c084fc;
}

.footer-bottom {
  text-align: center;
  color: #94a3b8;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Animations ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for game cards */
.games-grid .game-card:nth-child(2) { transition-delay: 0.15s; }
.games-grid .game-card:nth-child(3) { transition-delay: 0.3s; }

/* Scroll-linked scale animation for headings (Framer Motion replica) */
@supports (animation-timeline: view()) {
  .scale-on-scroll {
    animation: scaleHeading linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }

  @keyframes scaleHeading {
    0%   { transform: scale(2); }
    100% { transform: scale(1); }
  }
}

/* Fallback for browsers without scroll-timeline */
@supports not (animation-timeline: view()) {
  .scale-on-scroll {
    opacity: 0;
    transform: scale(1.5);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }
  .scale-on-scroll.visible {
    opacity: 1;
    transform: scale(1);
  }
}

/* Coming Soon button */
.coming-soon-badge {
  display: block;
  width: 100%;
  max-width: 180px;
  background: #9ca3af;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  border: none;
  cursor: default;
}

/* ===== Admin Page ===== */
.admin-container {
  max-width: 64rem;
  margin: 2rem auto;
  padding: 0 1rem;
}

.admin-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.admin-section h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--brand);
  text-transform: uppercase;
}

.admin-field {
  margin-bottom: 1.25rem;
}

.admin-field label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-medium);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-field input,
.admin-field textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.admin-field input:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,39,241,0.1);
}

.admin-field textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding: 2rem 0;
  position: sticky;
  bottom: 0;
  background: var(--bg-light);
}
