/* ============================================
   Cairn合同会社 コーポレートサイト
   ============================================ */

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

:root {
  --near-black:    #090805;
  --surface:       #1c1a16;
  --copper:        #B87333;
  --copper-light:  #C9874F;
  --copper-dark:   #7A4A1E;
  --text:          #e8ddd0;
  --text-dim:      #5a5045;

  /* 既存セクション用エイリアス */
  --bg-main:        var(--near-black);
  --bg-sub:         var(--surface);
  --text-primary:   var(--text);
  --text-secondary: #A09080;

  --font-en:   Georgia, serif;
  --font-ja:   'Hiragino Mincho Pro', 'Yu Mincho', 'MS Mincho', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: monospace;
  --max-width: 860px;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--near-black);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  transition: background 0.4s ease, padding 0.3s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(9, 8, 5, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 40px;
  border-bottom-color: rgba(184, 115, 51, 0.15);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 7px;
  color: var(--copper);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-brand:hover {
  color: var(--copper-light);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1.5px;
  font-family: var(--font-ja);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--copper-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--copper);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Hero ---- */

#hero {
  height: 280vh;
  position: relative;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.base {
  position: absolute;
  inset: 0;
  background: var(--near-black);
}

.glow-edge {
  position: absolute;
  inset: 0;
  background: var(--copper);
  filter: blur(8px);
  opacity: 0;
  will-change: clip-path;
  pointer-events: none;
  clip-path: polygon(0% 50%, 100% 50%, 100% 50.1%, 0% 50.1%);
}

.mountain {
  position: absolute;
  inset: 0;
  will-change: clip-path;
  clip-path: polygon(0% 50%, 100% 50%, 100% 50.1%, 0% 50.1%);
}

.mountain svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trail-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.waypoint {
  opacity: 0;
}

.logotype {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.logotype-name {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0.45em;
  color: var(--text);
  font-family: var(--font-mono);
}

.logotype-tagline {
  font-size: clamp(10px, 1.2vw, 13px);
  color: var(--copper);
  letter-spacing: 0.22em;
  margin-top: 14px;
  font-family: var(--font-ja);
}

/* ---- Star waypoint hover ---- */

.trail-overlay .waypoint-star {
  pointer-events: all;
  cursor: default;
}

/* ---- Section Common ---- */

section:not(#hero) {
  padding: 96px 24px;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--copper-dark);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-ja);
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: normal;
  letter-spacing: 0.18em;
  color: var(--text);
}

.section-divider {
  width: 36px;
  height: 1px;
  background: var(--copper);
  margin: 20px 0 52px;
  opacity: 0.7;
}

/* ---- About ---- */

#about {
  background: var(--near-black);
}

.about-table {
  width: 100%;
  border-collapse: collapse;
}

.about-table th,
.about-table td {
  padding: 20px 0;
  border-bottom: 1px solid rgba(184, 115, 51, 0.1);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.8;
}

.about-table th {
  color: var(--text-secondary);
  font-weight: normal;
  font-family: var(--font-ja);
  width: 140px;
  letter-spacing: 0.06em;
  padding-right: 24px;
}

.about-table td {
  color: var(--text);
  font-family: var(--font-ja);
}

/* ---- Business ---- */

#business {
  background: var(--surface);
}

.business-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.business-card {
  background: var(--surface);
  border: 1px solid rgba(184, 115, 51, 0.18);
  border-top: 2px solid var(--copper);
  padding: 40px 32px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.business-card:hover {
  border-color: rgba(201, 135, 79, 0.5);
  border-top-color: var(--copper-light);
  transform: translateY(-3px);
}

.business-card-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--copper-dark);
  margin-bottom: 20px;
}

.business-card h3 {
  font-family: var(--font-ja);
  font-size: 16px;
  font-weight: normal;
  color: var(--copper-light);
  letter-spacing: 0.06em;
  line-height: 1.7;
  margin-bottom: 18px;
}

.business-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.95;
  font-family: var(--font-ja);
}

/* ---- Contact ---- */

#contact {
  background: var(--surface);
  text-align: center;
}

#contact .section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#contact .section-divider {
  margin-left: auto;
  margin-right: auto;
}

.contact-message {
  font-family: var(--font-ja);
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin-bottom: 28px;
  line-height: 2;
}

.contact-email-link {
  display: block;
  margin: 0 auto 56px;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.contact-email-link:hover {
  opacity: 1;
}

.contact-email-img {
  display: block;
  height: 34px;
  width: auto;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Contact Form ---- */

.contact-form {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-family: var(--font-ja);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-required {
  color: var(--copper);
  margin-left: 2px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(184, 115, 51, 0.2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(160, 144, 128, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(184, 115, 51, 0.6);
  background: rgba(184, 115, 51, 0.04);
}

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

.form-submit {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid var(--copper);
  color: var(--copper);
  font-family: var(--font-ja);
  font-size: 13px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  margin-top: 8px;
}

.form-submit:hover:not(:disabled) {
  background: var(--copper);
  color: var(--near-black);
}

.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  max-width: 520px;
  margin: 20px auto 0;
  font-family: var(--font-ja);
  font-size: 13px;
  line-height: 1.85;
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 0;
}

.form-status.success {
  color: var(--copper-light);
}

.form-status.error {
  color: #c0705a;
}

/* ---- Footer ---- */

footer {
  background: var(--near-black);
  border-top: 1px solid rgba(184, 115, 51, 0.1);
  padding: 44px 24px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--copper-dark);
}

.footer-privacy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  font-family: var(--font-ja);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(160, 144, 128, 0.4);
  transition: color 0.2s;
  padding: 0;
}

.footer-privacy:hover {
  color: var(--copper-light);
}

/* ---- Privacy Modal ---- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid rgba(184, 115, 51, 0.2);
  max-width: 660px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 52px 48px;
  position: relative;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--text-secondary);
  line-height: 1;
  padding: 6px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--copper-light);
}

.modal h2 {
  font-family: var(--font-ja);
  font-size: 17px;
  font-weight: normal;
  color: var(--copper);
  letter-spacing: 0.2em;
  margin-bottom: 36px;
}

.modal h3 {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: normal;
  color: var(--copper-light);
  letter-spacing: 0.06em;
  margin: 28px 0 8px;
}

.modal p,
.modal li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.95;
  font-family: var(--font-ja);
}

.modal ul {
  padding-left: 1.3em;
  margin-top: 6px;
}

.modal li {
  margin-bottom: 4px;
}

/* ---- Fade-in Animation ---- */

.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---- Accessibility: Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
  .mountain {
    clip-path: none !important;
    will-change: auto;
  }
  .glow-edge {
    display: none;
  }
  .trail-overlay {
    display: none;
  }
  .logotype {
    opacity: 1 !important;
  }
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .nav {
    padding: 18px 20px;
  }

  .nav.scrolled {
    padding: 13px 20px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(9, 8, 5, 0.97);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 8px 0 20px;
    border-bottom: 1px solid rgba(184, 115, 51, 0.15);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 15px 0;
    font-size: 14px;
    letter-spacing: 2px;
  }

  .nav-toggle {
    display: flex;
  }

  .glow-edge {
    filter: blur(4px);
  }

  section:not(#hero) {
    padding: 72px 20px;
  }

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

  .business-card {
    padding: 28px 24px;
  }

  .about-table th {
    width: 100px;
    font-size: 13px;
    padding-right: 16px;
  }

  .about-table td {
    font-size: 13px;
  }

  .modal {
    padding: 40px 24px;
    max-height: 88vh;
  }
}

@media (max-width: 480px) {
  .about-table {
    display: block;
  }

  .about-table tbody,
  .about-table tr {
    display: block;
  }

  .about-table th,
  .about-table td {
    display: block;
    width: 100%;
    padding: 8px 0;
    border-bottom: none;
  }

  .about-table th {
    color: var(--copper-dark);
    font-size: 11px;
    letter-spacing: 2px;
    padding-top: 20px;
  }

  .about-table tr {
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
  }
}
