/* =========================================
   Saroma Society - Modern CSS Design System
   ========================================= */

:root {
  /* --- Light Theme (Default) --- */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.7);
  --bg-card: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --brand-primary: #0d9488;
  /* Teal 600 */
  --brand-primary-dark: #0f766e;
  /* Teal 700 */
  --brand-secondary: #f97316;
  /* Orange 500 */

  --border-light: #e2e8f0;
  --border-focus: #0d9488;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.15);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --font-sans: 'Sora', sans-serif;
  --font-serif: 'Merriweather', serif;
}

[data-theme="dark"] {
  /* --- Dark Theme --- */
  --bg-body: #0f172a;
  /* Slate 900 */
  --bg-surface: #1e293b;
  /* Slate 800 */
  --bg-surface-glass: rgba(30, 41, 59, 0.8);
  --bg-card: #1e293b;

  --text-main: #f1f5f9;
  /* Slate 100 */
  --text-muted: #cbd5e1;
  /* Slate 300 */
  --text-light: #64748b;
  /* Slate 500 */

  --brand-primary: #14b8a6;
  /* Teal 500 (Brighter for dark mode) */
  --brand-primary-dark: #0d9488;
  --brand-secondary: #fb923c;
  /* Orange 400 */

  --border-light: #334155;
  /* Slate 700 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  /* Prevent horizontal scroll */
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand-primary-dark);
}

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

ul {
  list-style: none;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin-bottom: 1rem;
}

/* --- Layout --- */
.container {
  width: min(90%, 1280px);
  margin-inline: auto;
  padding-inline: 1rem;
}

.section {
  padding-block: 4rem;
}

/* --- Components --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.4);
  color: white;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: var(--bg-body);
}

.badge {
  display: inline-block;
  padding: 0.35em 0.8em;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Header & Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
  padding-block: 1rem;
  background: transparent;
}

.site-header.scrolled {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-block: 0.75rem;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-light);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  z-index: 1002;
}

.logo img {
  height: 40px;
  width: auto;
  border-radius: var(--radius-sm);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  padding-bottom: 0.25rem;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--brand-secondary);
  transition: width 0.3s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

.site-nav a.active {
  color: var(--brand-secondary);
}

.site-nav .nav-cta {
  margin-left: 0.25rem;
  padding: 0.55rem 1.1rem;
  color: #fff;
}

.site-nav .nav-cta::after {
  display: none;
}

.site-nav .nav-cta:hover {
  color: #fff;
}

/* --- Mobile Menu --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1002;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.nav-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Theme Toggle --- */
.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.theme-toggle-btn:hover {
  background-color: rgba(128, 128, 128, 0.1);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding-top: 8rem;
  /* Space for fixed header */
  padding-bottom: 4rem;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Background splashes */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 60%;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.4;
}

.hero::before {
  top: -10%;
  left: -10%;
  background: var(--brand-primary);
}

.hero::after {
  bottom: 10%;
  right: -10%;
  background: var(--brand-secondary);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1.5rem;
  background: linear-gradient(120deg, var(--text-main) 0%, var(--brand-primary) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Fallback */
  line-height: 1.1;
}

.hero-copy p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 90%;
}

.hero-media {
  position: relative;
}

.hero-media img,
.hero-media .slider,
.hero-media .hero-video {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

/* --- Slider Styles --- */
.slider {
  position: relative;
  aspect-ratio: 16/9;
}

.home-slider {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  background-size: cover;
  background-position: center;
}

.slide.active {
  opacity: 1;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  color: white;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.content-card,
.project-card,
.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

.content-card:hover,
.project-card:hover,
.member-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 148, 136, 0.3);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(13, 148, 136, 0.1);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* --- Projects --- */
.project-card {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.project-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
}

/* --- Inner Pages --- */
.page-header {
  padding-top: 8rem;
  padding-bottom: 3rem;
  text-align: center;
  background: linear-gradient(to bottom, rgba(13, 148, 136, 0.05), transparent);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding-block: 4rem 1rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: 0.3s;
}

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

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--brand-primary);
}

/* --- Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Contact Form --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-body);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-surface);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

/* --- News --- */
.news-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-content {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .news-card {
    grid-template-columns: 280px 1fr;
  }

  .news-image {
    height: 100%;
  }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 75%;
    max-width: 300px;
    background: var(--bg-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
  }

  .site-nav.open {
    transform: translateX(0);
  }

  .site-nav .nav-cta {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-grid {
    display: flex;
    flex-direction: column-reverse;
  }

  .hero-copy p {
    margin-inline: auto;
  }

  .hero-cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }
}
