/* ============================
   Eurea Design System
   FAS-inspired Luxury Minimal
   ============================ */

/* --- CSS Variables --- */
:root {
  /* Primary Colors (Stone palette) */
  --primary: #1C1917;
  --primary-light: #44403C;
  --accent: #CA8A04;
  --accent-light: #D4A017;
  --accent-dark: #A16207;

  /* Background & Surface */
  --bg: #FAFAF9;
  --bg-sub: #F5F5F4;
  --surface: #FFFFFF;

  /* Text */
  --text: #0C0A09;
  --text-muted: #78716C;
  --text-light: #A8A29E;

  /* Border */
  --border: #E7E5E4;
  --border-dark: #D6D3D1;

  /* Legacy aliases (for existing code compatibility) */
  --navy: #1C1917;
  --navy-light: #44403C;
  --gold: #CA8A04;
  --gold-light: #D4A017;
  --gold-dark: #A16207;
  --warm-white: #FAFAF9;
  --cream: #F5F5F4;
  --light-gray: #E7E5E4;
  --medium-gray: #78716C;

  /* Semantic Colors */
  --success: #16A34A;
  --error: #DC2626;
  --warning: #EA580C;
  --info: #2563EB;

  /* Typography */
  --font-heading: 'Noto Serif JP', 'Yu Mincho', serif;
  --font-heading-en: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-accent: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  /* Font Sizes (FAS-style compact) */
  --text-display: 56px;
  --text-h1: 32px;
  --text-h2: 24px;
  --text-h3: 20px;
  --text-h4: 17px;
  --text-body-lg: 16px;
  --text-body: 15px;
  --text-body-sm: 13px;
  --text-caption: 11px;
  --text-price: 28px;

  /* Spacing (8px grid, generous) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 80px;
  --space-3xl: 120px;
  --space-4xl: 160px;

  /* Layout */
  --content-max-width: 1400px;
  --content-narrow: 800px;
  --content-padding: 20px;
  --content-padding-pc: 48px;

  /* Borders — no radius (FAS-style sharp) */
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;

  /* Shadows (subtle) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast: 0.15s ease-out;
  --transition-base: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Page Entrance Animation --- */
@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  color: var(--text);
  line-height: 1.8;
  letter-spacing: 0.02em;
  background: var(--bg);
  overflow-x: hidden;
  animation: pageIn 0.6s ease-out;
}

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

a {
  color: var(--text);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.7;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  letter-spacing: 0.06em;
  line-height: 1.5;
  font-weight: 400;
}

h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.6;
}

h3 {
  font-size: var(--text-h3);
  line-height: 1.6;
}

h4 {
  font-size: var(--text-h4);
  line-height: 1.7;
}

p + p {
  margin-top: 1.2em;
}

.text-display {
  font-family: var(--font-heading-en);
  font-size: var(--text-display);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.text-body-lg {
  font-size: var(--text-body-lg);
  line-height: 1.8;
}

.text-body-sm {
  font-size: var(--text-body-sm);
  line-height: 1.7;
}

.text-caption {
  font-size: var(--text-caption);
  line-height: 1.6;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-price {
  font-family: var(--font-accent);
  font-size: var(--text-price);
  font-weight: 600;
  line-height: 1.2;
}

.text-center { text-align: center; }
.text-gold { color: var(--accent); }
.text-navy { color: var(--text); }
.text-gray { color: var(--text-muted); }

/* Section subtitle — English accent text */
.section-subtitle-en {
  font-family: var(--font-heading-en);
  font-size: var(--text-caption);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Focus Styles (Accessibility) --- */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* --- Buttons (FAS-style border-based) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 40px;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transition: transform 0.4s ease-out;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary::before {
  background: var(--bg);
  transform: scaleX(0);
  transform-origin: right;
}

.btn-primary:hover {
  color: var(--text);
  opacity: 1;
}

.btn-primary:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--border);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}

.btn-secondary::before {
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
}

.btn-secondary:hover {
  color: var(--bg);
  opacity: 1;
}

.btn-secondary:hover::before {
  transform: scaleX(1);
  transform-origin: right;
}

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

.btn-outline::before {
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.btn-outline:hover {
  color: var(--bg);
  opacity: 1;
}

.btn-outline:hover::before {
  transform: scaleX(1);
  transform-origin: right;
}

.btn-sm {
  min-height: 40px;
  padding: 10px 24px;
  font-size: var(--text-caption);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  gap: 8px;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.04em;
}

.form-label .required {
  color: var(--error);
  margin-left: 4px;
  font-size: var(--text-caption);
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--text);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-light);
  font-size: var(--text-body-sm);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-sm);
  color: var(--error);
  font-size: var(--text-body-sm);
}

.form-error::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--error);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.form-hint {
  margin-top: var(--space-xs);
  font-size: var(--text-body-sm);
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 48px;
}

.checkbox-group,
.radio-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--text);
  flex-shrink: 0;
}

/* --- Cards (FAS-style flat) --- */
.card {
  background: var(--surface);
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.card:hover {
  opacity: 0.9;
}

.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-sub);
}

.card-body {
  padding: var(--space-lg);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.card-price {
  font-family: var(--font-accent);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.card-price .tax {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 400;
  color: var(--text-muted);
}

/* --- Grid --- */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.container-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* --- Section --- */
.section {
  padding: var(--space-3xl) 0;
}

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

.section-navy,
.section-dark {
  background: var(--primary);
  color: var(--bg);
}

.section-navy h2,
.section-navy h3,
.section-navy h4,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--bg);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title h2 {
  margin-bottom: var(--space-sm);
}

.section-title p {
  font-size: var(--text-body);
  color: var(--text-muted);
}

.section-divider {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: var(--space-md) auto;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-gold {
  background: rgba(202, 138, 4, 0.08);
  color: var(--accent-dark);
}

.badge-success {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.badge-error {
  background: rgba(220, 38, 38, 0.08);
  color: var(--error);
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}

th, td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 500;
  background: var(--bg-sub);
  white-space: nowrap;
  font-size: var(--text-body-sm);
  letter-spacing: 0.04em;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.hidden { display: none !important; }

/* --- Link Hover Underline Animation (left→right) --- */
.link-hover-line {
  position: relative;
  display: inline-block;
}

.link-hover-line::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-out;
}

.link-hover-line:hover::after {
  transform: scaleX(1);
}

.link-hover-line:hover {
  opacity: 1;
}

/* --- Image Fade-in on Load --- */
.img-fade {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.img-fade.is-loaded {
  opacity: 1;
}

/* --- Scroll Reveal Base --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll Reveal Variants */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger Delay Utilities */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (min-width: 768px) {
  :root {
    --content-padding: var(--content-padding-pc);
  }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }

  .section {
    padding: var(--space-4xl) 0;
  }
}

@media (min-width: 768px) {
  .text-display {
    font-size: var(--text-display);
  }
}

@media (max-width: 767px) {
  :root {
    --text-display: 36px;
    --text-h1: 26px;
    --text-h2: 21px;
    --text-h3: 18px;
    --text-h4: 16px;
    --text-price: 24px;
    --space-3xl: 80px;
    --space-4xl: 100px;
  }

  .btn-primary {
    min-width: 0;
    width: 100%;
  }

  .sp-only { display: block; }
  .pc-only { display: none; }
}

@media (min-width: 768px) {
  .sp-only { display: none; }
  .pc-only { display: block; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }

  .fade-in,
  .fade-up,
  .fade-left,
  .fade-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .img-fade {
    opacity: 1;
    transition: none;
  }

  .link-hover-line::after {
    transition: none;
  }

  .btn::before {
    transition: none;
  }

  .btn:active {
    transform: none;
  }

  .delay-1,
  .delay-2,
  .delay-3,
  .delay-4,
  .delay-5 {
    transition-delay: 0s;
  }
}
