/* ──────────────────────────────────────────
   Towa Construction — shared stylesheet
   All language versions share this baseline.
   Arabic (/ar/) layers RTL overrides inline.
   ────────────────────────────────────────── */

:root {
  --ink: #1a1814;
  --paper: #f5f2ec;
  --sand: #d4c9a8;
  --rust: #8b4a2f;
  --gold: #c5a55a;
  --smoke: #6b6560;
  --light: #ece8df;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-weight: 300;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 60px;
  background: rgba(245,242,236,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sand);
  gap: 20px;
}
.nav-logo {
  font-family: 'Noto Serif JP', serif;
  font-size: 17px;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo span { color: var(--rust); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--smoke);
  text-decoration: none;
  transition: color 0.3s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--rust); }

.nav-right { display: flex; align-items: center; gap: 18px; }

/* ── LANGUAGE SWITCHER ── */
.lang-switcher { position: relative; }
.lang-current {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--sand);
  color: var(--smoke);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.3s, color 0.3s;
}
.lang-current:hover { color: var(--rust); border-color: var(--rust); }
.lang-current .caret { font-size: 9px; opacity: 0.7; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--paper);
  border: 1px solid var(--sand);
  list-style: none;
  min-width: 160px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(26,24,20,0.08);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 220;
}
.lang-switcher.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li { margin: 0; }
.lang-menu a {
  display: block;
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--smoke);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.lang-menu a:hover { background: rgba(212,201,168,0.25); color: var(--rust); }
.lang-menu li.active a { color: var(--rust); font-weight: 400; }

/* ── HAMBURGER ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 61px; left: 0; right: 0;
  background: rgba(245,242,236,0.98);
  border-bottom: 1px solid var(--sand);
  z-index: 190;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease, padding 0.3s;
}
.mobile-menu.open {
  max-height: 500px;
  padding: 16px 0;
}
.mobile-menu a {
  display: block;
  padding: 14px 28px;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--smoke);
  text-decoration: none;
  border-bottom: 1px solid rgba(212,201,168,0.3);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--rust); background: rgba(212,201,168,0.1); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 61px;
  overflow: hidden;
}
.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 60px 80px 80px;
}
.hero-tag {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--rust);
  text-transform: uppercase;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 1s 0.3s forwards;
}
.hero-title {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(30px, 3.5vw, 52px);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.05em;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 1s 0.5s forwards;
}
.hero-title em {
  font-style: normal;
  color: var(--rust);
  font-weight: 600;
}
.hero-sub {
  font-size: 13px;
  line-height: 2;
  color: var(--smoke);
  max-width: 380px;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeUp 1s 0.7s forwards;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 8px;
  transition: gap 0.3s, color 0.3s;
  opacity: 0;
  animation: fadeUp 1s 0.9s forwards;
  width: fit-content;
}
.hero-cta:hover { gap: 22px; color: var(--rust); }
.hero-cta::after { content: '→'; }

.hero-right {
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 1.5s 0.4s forwards;
}
.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: sepia(20%) contrast(1.05);
}
.hero-img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(26,24,20,0.15) 0%, transparent 60%);
}

/* ── HERO MARK (建築 / ARCHITECTURE) ──
   Original aesthetic: small text + crosshair lines, centered.
   PC and mobile share the same composition (just slight font-size bump on PC).*/
.hero-mark {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: 'Noto Serif JP', serif;
  text-align: center;
}
/* Crosshair: vertical line via ::before, horizontal line via ::after */
.hero-mark::before,
.hero-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(255, 248, 230, 0.35);
  transform: translate(-50%, -50%);
}
.hero-mark::before { width: 1px; height: 140px; }     /* vertical */
.hero-mark::after  { width: 140px; height: 1px; }     /* horizontal */

.hero-mark-kanji {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.55em;
  color: rgba(255, 248, 230, 0.85);
  line-height: 1;
  text-indent: 0.55em;
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
}
.hero-mark-label {
  font-size: 12px;
  letter-spacing: 0.5em;
  color: rgba(255, 248, 230, 0.55);
  text-indent: 0.5em;
  position: relative;
  z-index: 1;
}

.hero-year {
  position: absolute;
  bottom: 40px; right: 40px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 100px;
  font-weight: 300;
  color: rgba(255,255,255,0.15);
  line-height: 1;
}

/* ── SECTIONS ── */
section { padding: 100px 80px; }
.sec-label {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--rust);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.sec-title {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin-bottom: 56px;
}

/* ── ABOUT ── */
.about { background: #1a1814; color: var(--paper); }
.about .sec-label { color: var(--gold); }
.about .sec-title { color: var(--paper); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}
.about-text { font-size: 14px; line-height: 2.2; color: rgba(245,242,236,0.75); }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.stat { border-top: 1px solid rgba(197,165,90,0.35); padding-top: 22px; }
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label { font-size: 11px; letter-spacing: 0.1em; color: rgba(245,242,236,0.5); line-height: 1.6; }

/* ── PROJECTS ── */
.projects { background: var(--light); }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.project-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
}
.project-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.project-card:hover img { transform: scale(1.05); }
.project-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,24,20,0.88) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 22px;
  background: linear-gradient(to top, rgba(26,24,20,0.85) 0%, transparent 100%);
}
.project-type { font-size: 9px; letter-spacing: 0.3em; color: var(--gold); margin-bottom: 6px; }
.project-name {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(13px, 1.5vw, 17px);
  color: white;
  font-weight: 300;
  line-height: 1.4;
}
.project-loc { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 4px; }

/* ── SERVICES / KNOWLEDGE CARDS ── */
.services { background: var(--paper); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.service-card {
  padding: 40px 0;
  border-top: 1px solid var(--sand);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s;
}
a.service-card:hover { transform: translateY(-4px); }
a.service-card:hover .service-title { color: var(--rust); }
.service-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 300;
  color: var(--sand);
  margin-bottom: 20px;
  line-height: 1;
}
.service-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 19px;
  font-weight: 400;
  margin-bottom: 14px;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}
.service-desc { font-size: 13px; line-height: 2; color: var(--smoke); }
.service-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
}

/* ── KNOWLEDGE BASE ── */
.knowledge { background: var(--light); }
.knowledge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.kb-card {
  background: var(--paper);
  padding: 36px 32px;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid transparent;
  transition: border-color 0.3s, transform 0.3s;
}
.kb-card:hover { border-color: var(--sand); transform: translateY(-3px); }
.kb-card:hover .kb-title { color: var(--rust); }
.kb-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 18px;
}
.kb-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 17px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  line-height: 1.5;
  transition: color 0.3s;
}
.kb-desc { font-size: 13px; line-height: 1.9; color: var(--smoke); }
.kb-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--rust);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ── ARTICLE PAGE ── */
.article-hero {
  padding: 160px 80px 60px;
  background: var(--paper);
  border-bottom: 1px solid var(--sand);
}
.article-hero .breadcrumb {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--smoke);
  margin-bottom: 24px;
}
.article-hero .breadcrumb a { color: var(--rust); text-decoration: none; }
.article-hero .breadcrumb a:hover { text-decoration: underline; }
.article-hero h1 {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.45;
  margin-bottom: 20px;
  max-width: 880px;
}
.article-hero .lede {
  font-size: 15px;
  line-height: 2;
  color: var(--smoke);
  max-width: 720px;
}
.article-body {
  background: var(--paper);
  padding: 70px 80px 100px;
  max-width: 880px;
  margin: 0 auto;
}
.article-body h2 {
  font-family: 'Noto Serif JP', serif;
  font-size: 24px;
  font-weight: 400;
  margin: 48px 0 18px;
  color: var(--ink);
  letter-spacing: 0.04em;
  border-left: 3px solid var(--rust);
  padding-left: 14px;
}
.article-body h3 {
  font-family: 'Noto Serif JP', serif;
  font-size: 17px;
  font-weight: 500;
  margin: 32px 0 12px;
  color: var(--rust);
}
.article-body p {
  font-size: 14px;
  line-height: 2.05;
  color: var(--ink);
  margin-bottom: 18px;
}
.article-body ul, .article-body ol {
  margin: 12px 0 24px 22px;
  font-size: 14px;
  line-height: 2;
  color: var(--ink);
}
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 22px;
  margin: 28px 0;
  font-style: italic;
  color: var(--smoke);
  font-size: 14px;
  line-height: 1.95;
}
.article-body strong { color: var(--rust); font-weight: 500; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 13px;
}
.article-body th, .article-body td {
  border-bottom: 1px solid var(--sand);
  padding: 12px 10px;
  text-align: start;
  line-height: 1.6;
}
.article-body th { color: var(--rust); font-weight: 500; }

.article-stub-notice {
  margin: 36px 0;
  padding: 26px 28px;
  background: var(--light);
  border-left: 3px solid var(--gold);
  font-size: 13px;
  line-height: 1.9;
  color: var(--smoke);
}
.article-stub-notice strong { color: var(--rust); }
.article-stub-notice a { color: var(--rust); }

.related {
  background: var(--light);
  padding: 70px 80px 100px;
}
.related h3 {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 28px;
  letter-spacing: 0.05em;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* ── COMPANY ── */
.company { background: #1a1814; color: var(--paper); }
.company .sec-label { color: var(--gold); }
.company .sec-title { color: var(--paper); }
.company-table { width: 100%; border-collapse: collapse; }
.company-table tr { border-bottom: 1px solid rgba(197,165,90,0.12); }
.company-table td { padding: 20px 0; font-size: 14px; vertical-align: top; line-height: 1.9; }
.company-table td:first-child {
  width: 180px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding-right: 16px;
  white-space: nowrap;
}
.company-table td:last-child { color: rgba(245,242,236,0.8); }

/* ── CONTACT ── */
.contact { background: var(--rust); text-align: center; padding: 90px 40px; }
.contact .sec-label { color: rgba(245,242,236,0.6); }
.contact .sec-title { color: white; margin-bottom: 32px; }
.contact-desc { color: rgba(255,255,255,0.75); font-size: 14px; line-height: 2; margin-bottom: 36px; }
.contact-email {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 300;
  color: white;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 6px;
  transition: border-color 0.3s;
  display: inline-block;
  margin-bottom: 40px;
  word-break: break-all;
}
.contact-email:hover { border-color: white; }
.contact-tel { font-size: 14px; color: rgba(255,255,255,0.7); letter-spacing: 0.12em; }

/* ── FOOTER ── */
footer {
  background: #1a1814;
  color: rgba(245,242,236,0.35);
  padding: 32px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(197,165,90,0.08);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE TABLET ≤900px ── */
@media (max-width: 900px) {
  nav { padding: 16px 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .lang-current { padding: 7px 10px; font-size: 10px; }

  .hero {
    grid-template-columns: 1fr;
    min-height: 100svh;
    position: relative;
  }
  .hero-right {
    position: absolute;
    inset: 0;
    z-index: 0;
    animation: fadeIn 1.5s 0.4s forwards;
  }
  .hero-right::after {
    content: '';
    position: absolute; inset: 0;
    /* Light at top (let the 建築 mark breathe), dark at bottom (legible title overlay) */
    background: linear-gradient(to bottom, rgba(26,24,20,0.15) 0%, rgba(26,24,20,0.35) 45%, rgba(26,24,20,0.78) 100%);
  }
  /* Mobile: keep mark centered like PC; the strong bottom-darkening
     gradient above keeps the title legible. Slightly smaller cross
     so it doesn't dominate a narrow viewport. */
  .hero-mark::before { height: 110px; }
  .hero-mark::after  { width: 110px; }
  .hero-mark-kanji { font-size: 22px; margin-bottom: 18px; }
  .hero-mark-label { font-size: 11px; }
  .hero-left {
    position: relative;
    z-index: 1;
    padding: 110px 28px 72px;
    justify-content: flex-end;
  }
  .hero-tag { color: rgba(245,242,236,0.8); }
  .hero-title { color: var(--paper); font-size: clamp(28px, 7vw, 42px); }
  .hero-title em { color: #e8a070; }
  .hero-sub { color: rgba(245,242,236,0.75); max-width: 100%; }
  .hero-cta {
    color: var(--paper);
    border-color: rgba(197,165,90,0.7);
  }
  .hero-cta:hover { color: #e8c070; }
  .hero-year { display: none; }

  section { padding: 64px 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .services-grid, .knowledge-grid, .related-grid { grid-template-columns: 1fr; gap: 0; }
  .knowledge-grid { gap: 18px; }
  .related-grid { gap: 14px; }
  .service-card { padding: 32px 0; }
  .company-table td:first-child { width: 120px; font-size: 11px; }
  .company-table td { font-size: 13px; }
  .article-hero { padding: 120px 24px 50px; }
  .article-body { padding: 50px 24px 80px; }
  .related { padding: 50px 24px 80px; }
  footer { padding: 28px 24px; flex-direction: column; gap: 10px; text-align: center; }
}

/* ── RESPONSIVE MOBILE ≤480px ── */
@media (max-width: 480px) {
  .nav-logo { font-size: 14px; }
  .hero-left { padding: 90px 20px 60px; }
  .hero-title { font-size: clamp(26px, 8vw, 36px); }
  section { padding: 56px 20px; }
  .projects-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 24px; }
  .company-table { display: block; }
  .company-table tbody { display: block; }
  .company-table tr { display: block; padding: 16px 0; border-bottom: 1px solid rgba(197,165,90,0.12); }
  .company-table td { display: block; width: 100% !important; padding: 2px 0; }
  .company-table td:first-child {
    font-size: 10px;
    letter-spacing: 0.15em;
    margin-bottom: 4px;
    color: var(--gold);
  }
  .contact-email { font-size: 14px; letter-spacing: 0.02em; }
}
