/* ============================================
   醤油のすべて - Global Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --soy-dark: #3D2B1F;
  --soy-medium: #6B4226;
  --soy-light: #A0522D;
  --cream: #FFF8E7;
  --cream-dark: #F5E6C8;
  --green-deep: #2D5016;
  --green-warm: #5B8C3E;
  --green-light: #A8D86E;
  --green-pale: #E8F5D4;
  --orange-warm: #E8913A;
  --orange-light: #F5C76B;
  --red-accent: #C23B22;

  --font-heading: 'Kiwi Maru', serif;
  --font-body: 'Zen Maru Gothic', sans-serif;
  --font-accent: 'Yomogi', cursive;

  --section-padding: 6rem 1.5rem;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--soy-dark);
  background-color: var(--cream);
  line-height: 1.8;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --- Hand-drawn Card --- */
.hand-drawn-card {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  border: 3px solid var(--soy-medium);
  background: var(--cream);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hand-drawn-card:hover {
  transform: rotate(-1deg) scale(1.02);
  box-shadow: 4px 4px 0 var(--orange-warm);
}

/* --- Sketch Border --- */
.sketch-border {
  box-shadow:
    2px 2px 0 var(--soy-medium),
    -1px -1px 0 var(--soy-medium),
    1px -1px 0 var(--soy-medium),
    -1px 1px 0 var(--soy-medium);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-header__en {
  font-family: var(--font-accent);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--orange-warm);
  line-height: 1.1;
  transform: rotate(-2deg);
  display: inline-block;
  position: relative;
}

.section-header__ja {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--soy-medium);
  margin-top: 0.5rem;
  letter-spacing: 0.2em;
}

.section-header__brush {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 12px;
  opacity: 0.3;
}

/* --- Stamp Badge --- */
.stamp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border: 4px solid var(--red-accent);
  border-radius: 50%;
  font-family: var(--font-heading);
  color: var(--red-accent);
  transform: rotate(-8deg);
  position: relative;
}

.stamp-badge::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid var(--red-accent);
  border-radius: 50%;
  opacity: 0.5;
}

/* ============================================
   Header
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 248, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--green-warm);
  transition: transform 0.3s ease;
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.header__logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--soy-medium);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__logo-icon {
  width: 32px;
  height: 32px;
}

.header__nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header__nav a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--soy-medium);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.header__nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange-warm);
  transition: width 0.3s ease;
}

.header__nav a:hover {
  color: var(--orange-warm);
}

.header__nav a:hover::after {
  width: 100%;
}

/* Mobile menu button */
.header__menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.header__menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--soy-medium);
  margin: 5px 0;
  transition: 0.3s;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #87CEEB 0%, #B8E4A0 40%, var(--green-warm) 70%, var(--green-deep) 100%);
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__clouds {
  position: absolute;
  top: 5%;
  width: 100%;
  animation: drift 60s linear infinite;
}

.hero__mountains {
  position: absolute;
  bottom: 15%;
  width: 100%;
}

.hero__trees {
  position: absolute;
  bottom: 0;
  width: 100%;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero__content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
}

.hero__mascot {
  width: 160px;
  height: 160px;
  margin: 0 auto 1.5rem;
  animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: #fff;
  text-shadow: 3px 3px 0 var(--soy-medium), 6px 6px 0 rgba(0,0,0,0.1);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero__subtitle {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--orange-light);
  margin-bottom: 2rem;
}

.hero__cta {
  display: inline-block;
  background: var(--orange-warm);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  padding: 0.8rem 2.5rem;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  border: 3px solid var(--soy-dark);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.hero__cta:hover {
  transform: rotate(-2deg) scale(1.05);
  box-shadow: 4px 4px 0 var(--soy-dark);
}

/* ============================================
   Marquee
   ============================================ */
.marquee {
  position: relative;
  z-index: 20;
  background: var(--orange-warm);
  border-top: 3px solid var(--soy-dark);
  border-bottom: 3px solid var(--soy-dark);
  padding: 0.75rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee__track {
  display: inline-flex;
  animation: marquee-scroll 20s linear infinite;
}

.marquee__text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #fff;
  padding: 0 2rem;
  flex-shrink: 0;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================
   History Section
   ============================================ */
.history {
  padding: var(--section-padding);
  background: var(--cream);
  position: relative;
}

.history__timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.history__timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(
    to bottom,
    var(--soy-medium) 0px,
    var(--soy-medium) 8px,
    transparent 8px,
    transparent 16px
  );
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
  padding-right: calc(50% + 2rem);
  text-align: right;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
  padding-left: calc(50% + 2rem);
  text-align: left;
}

.timeline-item__dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--cream);
  border: 3px solid var(--orange-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1;
}

.timeline-item__content {
  flex: 1;
}

.timeline-item__year {
  font-family: var(--font-accent);
  font-size: 1.5rem;
  color: var(--orange-warm);
  margin-bottom: 0.25rem;
}

.timeline-item__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--soy-medium);
  margin-bottom: 0.5rem;
}

.timeline-item__desc {
  font-size: 0.95rem;
  color: var(--soy-dark);
  line-height: 1.7;
}

/* ============================================
   How It's Made Section
   ============================================ */
.howmade {
  padding: var(--section-padding);
  background: linear-gradient(180deg, var(--green-warm) 0%, var(--green-deep) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.howmade .section-header__en {
  color: var(--orange-light);
}

.howmade .section-header__ja {
  color: rgba(255,255,255,0.8);
}

.howmade__steps {
  display: flex;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.step-card {
  flex: 0 0 200px;
  scroll-snap-align: center;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 1.5rem 1.2rem;
  text-align: center;
  position: relative;
  transition: transform 0.3s, background 0.3s;
}

.step-card:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.25);
}

.step-card__number {
  font-family: var(--font-accent);
  font-size: 2rem;
  color: var(--orange-light);
  line-height: 1;
}

.step-card__icon {
  font-size: 2.5rem;
  margin: 0.75rem 0;
}

.step-card__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.step-card__desc {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.6;
}

.step-card__arrow {
  position: absolute;
  right: -1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--orange-light);
}

.step-card:last-child .step-card__arrow {
  display: none;
}

/* ============================================
   Types Section
   ============================================ */
.types {
  padding: var(--section-padding);
  background: var(--cream);
}

.types__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.type-card {
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
}

.type-card__color-sample {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 3px solid var(--soy-medium);
  position: relative;
}

.type-card__name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--soy-medium);
  margin-bottom: 0.25rem;
}

.type-card__name-en {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  color: var(--orange-warm);
  margin-bottom: 0.75rem;
}

.type-card__desc {
  font-size: 0.9rem;
  line-height: 1.7;
}

.type-card__region {
  margin-top: 0.75rem;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  color: var(--green-warm);
}

/* ============================================
   Data Section
   ============================================ */
.data {
  padding: var(--section-padding);
  background: var(--soy-dark);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}

.data .section-header__en {
  color: var(--orange-light);
}

.data .section-header__ja {
  color: var(--cream-dark);
}

.data__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.data-item {
  text-align: center;
}

.data-item__stamp {
  width: 140px;
  height: 140px;
  margin: 0 auto 1rem;
}

.data-item__number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--orange-light);
  line-height: 1;
}

.data-item__unit {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--orange-warm);
}

.data-item__label {
  font-size: 0.9rem;
  color: var(--cream-dark);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ============================================
   News Section
   ============================================ */
.news {
  padding: var(--section-padding);
  background: var(--green-pale);
}

.news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.news-card {
  background: var(--cream);
  overflow: hidden;
  transition: transform 0.3s;
}

.news-card:hover {
  transform: rotate(-1deg) translateY(-4px);
}

.news-card__img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.news-card__body {
  padding: 1.25rem;
}

.news-card__date {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  color: var(--green-warm);
}

.news-card__tag {
  display: inline-block;
  background: var(--orange-warm);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  margin-left: 0.5rem;
  font-family: var(--font-heading);
}

.news-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--soy-medium);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.news-card__excerpt {
  font-size: 0.85rem;
  color: var(--soy-dark);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news__more {
  text-align: center;
  margin-top: 2.5rem;
}

.news__more a {
  display: inline-block;
  font-family: var(--font-heading);
  color: var(--green-deep);
  border: 2px dashed var(--green-warm);
  padding: 0.6rem 2rem;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: background 0.2s, color 0.2s;
}

.news__more a:hover {
  background: var(--green-warm);
  color: #fff;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: linear-gradient(180deg, var(--green-warm) 0%, var(--green-deep) 100%);
  color: #fff;
  padding: 3rem 1.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.footer__wave {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
}

.footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-top: 2rem;
}

.footer__brand {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__links a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer__links a:hover {
  opacity: 1;
}

.footer__copy {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* ============================================
   Divider
   ============================================ */
.divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.divider--wave svg {
  width: 100%;
  height: auto;
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 1rem;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 248, 231, 0.98);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 2px dashed var(--green-warm);
  }

  .header__nav.active {
    display: flex;
  }

  .header__menu-btn {
    display: block;
  }

  .hero__title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero__mascot {
    width: 120px;
    height: 120px;
  }

  /* Timeline - mobile: single column */
  .history__timeline::before {
    left: 24px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    flex-direction: row;
    padding-left: 5rem;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item__dot {
    left: 24px;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .howmade__steps {
    gap: 0.75rem;
  }

  .step-card {
    flex: 0 0 170px;
  }

  .types__grid {
    grid-template-columns: 1fr;
  }

  .data__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .news__grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__clouds {
    animation: none;
  }

  .hero__mascot {
    animation: none;
  }

  .marquee__track {
    animation: none;
  }
}
