/* 峰建築 — Corporate site
   Minimal, material-forward, refined-Japanese aesthetic.
*/

:root {
  /* Paper palette (default) */
  --bg: #F2EDE2;
  --bg-soft: #E8E1D1;
  --bg-deep: #DCD3BF;
  --ink: #1A1815;
  --ink-soft: #2C2A24;
  --muted: #6F665A;
  --muted-2: #9C9384;
  --hairline: #BFB39B;
  --hairline-soft: rgba(26,24,21,.12);
  --accent: #2C3E4A; /* 藍 */
  --paper-glow: rgba(255,253,247,.6);

  /* Type stacks */
  --serif-jp: "Shippori Mincho B1","Shippori Mincho",serif;
  --gothic-jp: "Zen Kaku Gothic New","Zen Kaku Gothic Antique",sans-serif;
  --serif-en: "EB Garamond","Cormorant Garamond",serif;
  --label: "Manrope",ui-sans-serif,system-ui,sans-serif;

  --maxw: 1320px;
  --gutter: clamp(20px, 5vw, 72px);
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
}

/* Dark "夜" palette */
[data-palette="ink"] {
  --bg: #16140F;
  --bg-soft: #1F1C16;
  --bg-deep: #2A2620;
  --ink: #F2EDE2;
  --ink-soft: #DCD3BF;
  --muted: #9C9384;
  --muted-2: #6F665A;
  --hairline: #4A4338;
  --hairline-soft: rgba(242,237,226,.12);
  --paper-glow: rgba(0,0,0,.4);
}

[data-accent="madder"] { --accent: #8E4A3A; }
[data-accent="moss"]   { --accent: #3F5040; }
[data-accent="indigo"] { --accent: #2C3E4A; }

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--gothic-jp);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "palt";
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Display type */
.h-mincho-jp { font-family: var(--serif-jp); font-weight: 500; letter-spacing: .04em; }
.h-gothic-jp { font-family: var(--gothic-jp); font-weight: 500; letter-spacing: .08em; }
[data-heading="gothic"] .h-display { font-family: var(--gothic-jp); font-weight: 500; letter-spacing: .08em; }
[data-heading="mincho"] .h-display { font-family: var(--serif-jp); font-weight: 500; letter-spacing: .04em; }

.h-display { line-height: 1.35; color: var(--ink); }
.h-garamond { font-family: var(--serif-en); font-weight: 400; font-style: italic; letter-spacing: .01em; }
.h-label    { font-family: var(--label); font-weight: 500; letter-spacing: .22em; text-transform: uppercase; font-size: 11px; color: var(--muted); }
.h-num      { font-family: var(--serif-en); font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }

/* Hairlines */
.hl { height: 1px; background: var(--hairline-soft); }
.hl-strong { background: var(--hairline); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.1s cubic-bezier(.22,.61,.36,1), transform 1.1s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }

/* Image placeholder — paper-on-paper, very subtle */
.ph {
  position: relative;
  background:
    linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-deep) 100%);
  color: var(--muted);
  overflow: hidden;
  border-radius: 2px;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(26,24,21,.04) 0 1px, transparent 1px 14px);
  pointer-events: none;
}
.ph .ph-label {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--label); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.ph .ph-num {
  position: absolute; right: 14px; top: 12px;
  font-family: var(--serif-en); font-style: italic; font-size: 14px; color: var(--muted);
}
.ph .ph-frame {
  position: absolute; inset: 14px;
  border: 1px solid rgba(26,24,21,.12);
}
[data-palette="ink"] .ph::before {
  background-image: repeating-linear-gradient(45deg, rgba(242,237,226,.04) 0 1px, transparent 1px 14px);
}
[data-palette="ink"] .ph .ph-frame {
  border-color: rgba(242,237,226,.12);
}

/* Hover gentle scale on image-containing tiles */
.tile { overflow: hidden; }
.tile .ph { transition: transform 1.4s cubic-bezier(.22,.61,.36,1); }
.tile:hover .ph { transform: scale(1.03); }

/* Section spacing */
section { padding: clamp(72px, 12vh, 160px) 0; position: relative; }
@media (max-width: 640px) {
  section { padding: 64px 0; }
}

/* Responsive grids — auto-collapse on mobile */
.grid { display: grid; gap: clamp(24px, 3vw, 48px); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 960px) {
  .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-6 { grid-template-columns: 1fr; }
  .grid { gap: 28px; }
  .grid-cols-2.keep-2 { grid-template-columns: 1fr 1fr; gap: 0; }
}

/* Hide on mobile */
.hide-mobile { }
.only-mobile { display: none !important; }
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .only-mobile { display: initial !important; }
  .only-mobile.flex { display: flex !important; }
}


/* Section header convention */
.sec-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: baseline;
  margin-bottom: clamp(48px, 8vh, 96px);
}
.sec-head .lbl-col { display: flex; flex-direction: column; gap: 8px; }
.sec-head .num { color: var(--muted-2); font-family: var(--serif-en); font-style: italic; font-size: 14px; }
.sec-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.3;
}
.sec-head .lead { color: var(--muted); max-width: 56ch; }

@media (max-width: 760px) {
  .sec-head { grid-template-columns: 1fr; gap: 12px; }
}

/* Buttons */
.btn-line {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 0; cursor: default;
  border-bottom: 1px solid var(--ink);
  font-family: var(--label); font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink);
  transition: gap .4s cubic-bezier(.22,.61,.36,1), color .3s, border-color .3s;
}
.btn-line::after { content: "→"; transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.btn-line:hover { gap: 22px; }
.btn-line:hover::after { transform: translateX(4px); }

.btn-fill {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 18px 28px; background: var(--ink); color: var(--bg);
  border-radius: 0;
  font-family: var(--label); font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  transition: background .3s, gap .4s cubic-bezier(.22,.61,.36,1);
}
.btn-fill:hover { gap: 22px; background: var(--accent); }

/* Selection */
::selection { background: var(--ink); color: var(--bg); }

/* Print-y noise overlay for atmosphere — optional, very subtle */
.noise::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .035 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .55; mix-blend-mode: multiply;
}
[data-palette="ink"] .noise::before { mix-blend-mode: screen; opacity: .35; }

/* ─── Component-level responsive overrides ──────────────────────────── */

/* Nav */
.nav-items, .nav-cta { display: flex; align-items: center; gap: 24px; }
.nav-cta { gap: 28px; }
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: 1px solid var(--ink); background: transparent;
  cursor: pointer;
}
.nav-burger span {
  display: block; width: 16px; height: 1px; background: var(--ink);
  position: relative;
}
.nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 1px; background: var(--ink);
}
.nav-burger span::before { top: -5px; }
.nav-burger span::after { top: 5px; }
.nav-burger[aria-expanded="true"] span { background: transparent; }
.nav-burger[aria-expanded="true"] span::before { transform: rotate(45deg); top: 0; }
.nav-burger[aria-expanded="true"] span::after  { transform: rotate(-45deg); top: 0; }

.mobile-menu {
  position: fixed; inset: 76px 0 0 0; z-index: 40;
  background: var(--bg);
  padding: 32px 24px 40px;
  display: flex; flex-direction: column; gap: 0;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity .3s, transform .3s;
  border-top: 1px solid var(--hairline-soft);
  overflow-y: auto;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; transform: none; }
.mobile-menu a.m-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 4px;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--gothic-jp); font-size: 18px; letter-spacing: .04em;
}
.mobile-menu a.m-item .m-en {
  font-family: var(--serif-en); font-style: italic; font-size: 13px; color: var(--muted);
}
.mobile-menu .m-cta {
  margin-top: 32px;
}

@media (max-width: 880px) {
  .nav-items { display: none; }
  .nav-cta .nav-contact { display: none; }
  .nav-burger { display: inline-flex; }
}

/* Section header */
@media (max-width: 760px) {
  .sec-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
  .sec-head h2 { font-size: 32px !important; }
}

/* Hero clamp adjustments */
.hero-headline {
  font-size: clamp(48px, 11vw, 188px);
  line-height: .98;
  letter-spacing: .01em;
  margin: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.hero-headline-split {
  font-size: clamp(56px, 8.5vw, 124px);
  line-height: 1.08;
  letter-spacing: .02em;
  margin: 0;
}
@media (max-width: 640px) {
  .hero-headline { font-size: clamp(40px, 13.5vw, 56px); }
  .hero-headline-split { font-size: clamp(44px, 14vw, 64px); }
}

.hero-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.hero-meta-sep { color: var(--muted-2); }
@media (max-width: 640px) {
  .hero-meta { gap: 10px; font-size: 10px; }
  .hero-meta-sep { display: none; }
}

.hero-sub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.hero-sub-row .cta-row { display: flex; gap: 24px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hero-sub-row { grid-template-columns: 1fr; gap: 32px; }
  .hero-sub-row .cta-row { justify-content: flex-start; gap: 20px; }
}

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats-cell {
  padding: 32px 24px 28px;
  border-right: 1px solid var(--hairline-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.stats-cell:last-child { border-right: none; }
@media (max-width: 760px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-cell { padding: 22px 16px; }
  .stats-cell:nth-child(2n) { border-right: none; }
  .stats-cell:nth-child(-n+2) { border-bottom: 1px solid var(--hairline-soft); }
  .stats-cell .h-num { font-size: 30px !important; }
}

/* About columns */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.about-text { padding-top: 10%; display: flex; flex-direction: column; gap: 28px; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-text { padding-top: 0; gap: 20px; }
}

/* Services row */
.svc-row {
  display: grid;
  grid-template-columns: 80px 1.1fr 1.4fr 1fr;
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  padding: 36px 0;
}
@media (max-width: 880px) {
  .svc-row { grid-template-columns: 60px 1fr; gap: 16px 24px; padding: 28px 0; }
  .svc-row .svc-desc { grid-column: 2; }
  .svc-row .svc-ex   { grid-column: 2; }
}

/* Works grid */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 4vw, 64px) clamp(20px, 2.5vw, 40px); }
@media (max-width: 960px) { .works-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .works-grid { grid-template-columns: 1fr; gap: 40px; } }

/* Process steps */
.process-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; position: relative; }
.process-row > .step-cell {
  padding: 0 16px 0 0;
  border-right: 1px dashed var(--hairline-soft);
  position: relative;
}
.process-row > .step-cell:last-child { border-right: none; padding-right: 0; }
.process-row > .step-cell:not(:first-child) { padding-left: 16px; }
.process-line { position: absolute; left: 0; right: 0; top: 18px; height: 1px; background: var(--hairline); }
@media (max-width: 880px) {
  .process-row { grid-template-columns: 1fr; }
  .process-line { display: none; }
  .process-row > .step-cell {
    border-right: none;
    border-top: 1px solid var(--hairline-soft);
    padding: 24px 0;
    display: grid; grid-template-columns: 50px 1fr; gap: 16px;
    align-items: start;
  }
  .process-row > .step-cell:not(:first-child) { padding-left: 0; }
  .process-row > .step-cell:first-child { border-top: 1px solid var(--hairline); }
  .process-row > .step-cell:last-child { border-bottom: 1px solid var(--hairline); }
  .process-row .step-circle { margin-bottom: 0 !important; grid-row: span 4; }
}

/* Message section */
.msg-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.msg-grid.vertical { grid-template-columns: 1fr 1.2fr; }
.msg-portrait .ph { aspect-ratio: 4 / 5; }
@media (max-width: 760px) {
  .msg-grid, .msg-grid.vertical { grid-template-columns: 1fr; gap: 32px; }
  /* Force horizontal writing on mobile — vertical writing breaks too tightly */
  .msg-body.vertical {
    writing-mode: horizontal-tb !important;
    max-height: none !important;
    font-size: 15px !important;
    line-height: 2.1 !important;
    letter-spacing: .04em !important;
  }
  .msg-body.vertical p { margin: 0 0 24px !important; }
}

/* Voice cards */
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); }
@media (max-width: 960px) { .voice-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .voice-grid { grid-template-columns: 1fr; gap: 20px; } }

/* News rows */
.news-row {
  display: grid;
  grid-template-columns: 120px 120px 1fr 60px;
  align-items: center; gap: 32px;
  padding: 24px 0;
}
@media (max-width: 760px) {
  .news-row {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "date cat arrow"
      "title title title";
    gap: 8px 12px;
    padding: 20px 0;
  }
  .news-row .news-date  { grid-area: date; }
  .news-row .news-cat   { grid-area: cat; }
  .news-row .news-arrow { grid-area: arrow; text-align: right; }
  .news-row .news-title { grid-area: title; font-size: 15px !important; }
}

/* Company section */
.company-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.dl-row { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 20px 0; }
@media (max-width: 760px) {
  .company-grid { grid-template-columns: 1fr; gap: 40px; }
  .dl-row { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
  .dl-row dt { font-size: 11px !important; letter-spacing: .14em !important; }
}

.access-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .access-pair { grid-template-columns: 1fr; gap: 20px; } }

/* CTA section */
.cta-row3 {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0;
  border-top: 1px solid rgba(242,237,226,.2);
  border-bottom: 1px solid rgba(242,237,226,.2);
}
.cta-row3 > div {
  padding: 32px;
  border-right: 1px solid rgba(242,237,226,.2);
}
.cta-row3 > div:first-child { padding-left: 0; }
.cta-row3 > div:last-child { border-right: none; }
@media (max-width: 760px) {
  .cta-row3 { grid-template-columns: 1fr; }
  .cta-row3 > div {
    border-right: none;
    border-bottom: 1px solid rgba(242,237,226,.2);
    padding: 28px 0 !important;
  }
  .cta-row3 > div:last-child { border-bottom: none; }
}

.cta-checks { display: flex; gap: 24px; flex-wrap: wrap; }
@media (max-width: 640px) { .cta-checks { gap: 8px 16px; font-size: 11px !important; } }

/* Footer */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; align-items: start; }
.footer-bottom {
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid rgba(242,237,226,.12);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid > div:first-child { grid-column: span 2; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid > div:first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-bottom > div { flex-wrap: wrap; gap: 16px !important; }
}

/* Hero placeholder height on mobile */
@media (max-width: 640px) {
  .hero-image-wrap .ph { aspect-ratio: 4 / 3 !important; }
}

/* Disable parallax transform on mobile (can cause overflow) */
@media (max-width: 760px) {
  .hero-image-wrap { transform: none !important; }
}

/* Tweaks panel scale at small viewports — leave host default */

.ph .ph-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;display:block}
