/* BRAIN — quiet luxury design system (ink & brass, dark-first) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-ink: #14161c;
  --color-ink-2: #1b1e27;
  --color-ink-3: #23262f;
  --color-ivory: #faf7f2;
  --color-white: #ffffff;
  --color-brass: #a9834c;
  --color-brass-soft: #c3a06f;

  --color-line: rgba(250, 247, 242, 0.14);
  --color-line-strong: rgba(250, 247, 242, 0.28);
  --color-text-soft: rgba(250, 247, 242, 0.68);

  /* used only inside the rare light-toned sections */
  --color-line-on-light: rgba(20, 22, 28, 0.14);
  --color-line-strong-on-light: rgba(20, 22, 28, 0.24);
  --color-ink-soft: rgba(20, 22, 28, 0.68);

  --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-2xs: 8px;
  --space-xs: 12px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 96px;
  --space-3xl: 140px;

  --measure: 1180px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ivory);
  background: var(--color-ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4, p {
  margin: 0;
}

.container {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* ===== Eyebrow label ===== */
.eyebrow {
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-brass);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Small rotating 3D mark (pure CSS, no WebGL) =====
   Two crossed brass frames spun on the Y axis — used as a
   recurring "3D detail" throughout eyebrows, footer, list rows. */
.mark3d {
  --mark-size: 14px;
  width: var(--mark-size);
  height: var(--mark-size);
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  perspective: 60px;
}

.mark3d .face {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--color-brass);
  transform-style: preserve-3d;
  animation: mark3d-spin 7s linear infinite;
}

.mark3d .face + .face {
  transform: rotateY(90deg);
  animation-delay: -3.5s;
}

@keyframes mark3d-spin {
  from { transform: rotateX(18deg) rotateY(0deg); }
  to   { transform: rotateX(18deg) rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mark3d .face {
    animation: none;
    transform: rotateX(18deg) rotateY(20deg);
  }
}

/* subtle CSS-only hover tilt, used on list rows / small cards */
.tilt-hover {
  transition: transform var(--dur-base) var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}

@media (hover: hover) {
  .tilt-hover:hover {
    transform: perspective(700px) rotateX(2deg) translateY(-2px);
  }
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 22, 28, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--color-ivory);
}

.logo-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: block;
  border-radius: 6px;
  transition: transform var(--dur-base) var(--ease-out);
}

@media (hover: hover) {
  .logo:hover .logo-icon {
    transform: perspective(200px) rotateY(22deg);
  }
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-ivory);
  border-bottom-color: var(--color-brass);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-line-strong);
  border-radius: 8px;
  background: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--color-ivory);
  position: relative;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-ink);
    border-bottom: 1px solid var(--color-line);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-base) var(--ease-out);
  }

  .nav-links.is-open {
    max-height: 320px;
  }

  .nav-links a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-line);
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid var(--color-line-strong);
  color: var(--color-ivory);
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.btn:hover {
  background: var(--color-brass);
  border-color: var(--color-brass);
  color: var(--color-ink);
}

.btn:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 2px;
}

/* used only on the rare light-toned sections */
.btn--on-light {
  border-color: var(--color-line-strong-on-light);
  color: var(--color-ink);
}

.btn--on-light:hover {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-ivory);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: var(--space-3xl) 0 var(--space-2xl);
  overflow: clip;
  background: var(--color-ink);
  color: var(--color-ivory);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

/* nudge the home hero's text/button left so it clears the large 3D sphere */
#hero-3d-home ~ .hero-inner {
  transform: translateX(-48px);
}

@media (max-width: 1080px) {
  #hero-3d-home ~ .hero-inner {
    transform: none;
  }
}

.no-break {
  white-space: nowrap;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero p.lead {
  margin-top: var(--space-md);
  font-size: 17px;
  line-height: 1.9;
  max-width: 560px;
  color: var(--color-text-soft);
}

.hero .btn {
  margin-top: var(--space-lg);
}

/* pattern variant A — dot-grid field (used on Home / Services) */
.hero--dotgrid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(169, 131, 76, 0.35) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, black, transparent);
  opacity: 0.6;
}

.hero--dotgrid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 85% 20%, rgba(169, 131, 76, 0.16), transparent 60%);
}

/* pattern variant B — fine diagonal rule field (used on About / Contact) */
.hero--diagonal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, var(--color-line) 0 1px, transparent 1px 64px);
  mask-image: linear-gradient(to left, black, transparent 75%);
}

/* minimal hero — heading only, no pattern */
.hero--minimal {
  padding-bottom: var(--space-xl);
}

/* article hero — long headlines need a smaller, tighter scale */
.hero--article {
  padding-top: var(--space-2xl);
}

.hero--article h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.45;
}

.hero--article .hero-inner {
  max-width: 820px;
}

/* ===== Section rhythm ===== */
.section {
  padding: var(--space-2xl) 0;
  background: var(--color-ink);
}

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

/* subtle alternate tone for rhythm — still dark, one step lighter */
.section--panel {
  background: var(--color-ink-2);
}

/* the one deliberately light band per page, used sparingly for contrast */
.section--light {
  background: var(--color-ivory);
  color: var(--color-ink);
}

.section--light .eyebrow {
  color: var(--color-brass);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-xl);
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.35;
}

/* ===== Divider row list (Strengths / Services) ===== */
.divider-list {
  border-top: 1px solid var(--color-line);
}

.divider-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-line);
}

.divider-row .row-index {
  flex: 0 0 96px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-latin);
  color: var(--color-brass);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding-top: 4px;
}

.divider-row .row-title {
  flex: 1 1 240px;
  min-width: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
}

.divider-row .row-body {
  flex: 2 1 320px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--color-text-soft);
}

/* stacked variant (3-up, used on home) */
.divider-list--stacked {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  border-top: none;
}

.divider-list--stacked .row-block {
  flex: 1 1 240px;
  min-width: 0;
  border-top: 2px solid var(--color-brass-soft);
  padding-top: var(--space-sm);
}

.divider-list--stacked .row-index {
  font-family: var(--font-latin);
  color: var(--color-brass);
  font-size: 13px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-xs);
}

.divider-list--stacked h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: var(--space-xs);
}

.divider-list--stacked p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--color-text-soft);
}

/* ===== Info list (About / Contact) ===== */
.info-list {
  border-top: 1px solid var(--color-line);
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-line);
}

.info-row .info-label {
  flex: 0 0 140px;
  font-family: var(--font-latin);
  color: var(--color-brass);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding-top: 2px;
}

.info-row .info-value {
  flex: 1 1 240px;
  min-width: 0;
  font-size: 16px;
  line-height: 1.75;
}

/* info list living on a light section (About page) needs ink-toned lines */
.section--light .info-list,
.section--light .info-row {
  border-color: var(--color-line-on-light);
}

/* ===== Two-column layout (Contact) ===== */
.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  align-items: flex-start;
}

.two-col > div {
  flex: 1 1 360px;
  min-width: 0;
}

/* ===== Form ===== */
.field {
  margin-bottom: var(--space-md);
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-2xs);
}

.field .req {
  color: var(--color-brass);
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--color-line-strong);
  background: rgba(250, 247, 242, 0.04);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-ivory);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(250, 247, 242, 0.35);
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-brass);
  background: rgba(250, 247, 242, 0.08);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 1px;
}

.contact-form {
  text-align: center;
}

.form-status {
  margin-top: var(--space-sm);
  font-size: 14px;
  color: var(--color-brass-soft);
  display: none;
}

.form-status.is-visible {
  display: block;
}

/* ===== 3D hero visual (Three.js canvas mount) ===== */
.hero-3d {
  position: absolute;
  top: 50%;
  right: 4%;
  transform: translateY(-50%);
  width: 460px;
  height: 460px;
  z-index: 0;
  pointer-events: auto;
}

.hero-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.hero-3d--small {
  width: 300px;
  height: 300px;
  right: 8%;
}

@media (max-width: 1080px) {
  .hero-3d {
    width: 340px;
    height: 340px;
    opacity: 0.7;
  }

  .hero-3d--small {
    width: 240px;
    height: 240px;
  }
}

@media (max-width: 780px) {
  .hero-3d {
    display: none;
  }
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

/* ===== Contact panel (unified, 3D tilt) ===== */
.contact-panel {
  background: var(--color-ink-2);
  border: 1px solid var(--color-line);
  border-radius: 20px;
  padding: var(--space-xl);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(169, 131, 76, 0.05) inset;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.3s var(--ease-out);
}

@media (max-width: 640px) {
  .contact-panel {
    padding: var(--space-lg) var(--space-md);
  }
}

.contact-intro {
  margin-bottom: var(--space-lg);
}

.contact-intro h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.contact-intro p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text-soft);
  max-width: 420px;
}

.contact-method {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-line);
}

.contact-method:last-child {
  border-bottom: none;
}

.contact-method .icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brass);
}

.contact-method .icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.contact-method .label {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--color-brass);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.contact-method .value {
  font-size: 16px;
  font-weight: 600;
}

.contact-method .value a {
  color: inherit;
  text-decoration: none;
}

.contact-method .value a:hover,
.contact-method .value a:focus-visible {
  color: var(--color-brass);
}

.contact-note {
  margin-top: var(--space-md);
  font-size: 13px;
  line-height: 1.8;
  color: var(--color-text-soft);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: var(--space-xl) 0;
  font-size: 13px;
  color: var(--color-text-soft);
  background: var(--color-ink);
}

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

.site-footer .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer .foot-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer .foot-links a:hover {
  color: var(--color-ivory);
}

/* ===== Insights list & article ===== */
.insight-row {
  display: block;
  text-decoration: none;
}

.insight-row .row-index {
  flex-basis: 120px;
}

.insight-row .row-title {
  transition: color var(--dur-fast) var(--ease-out);
}

.insight-row:hover .row-title {
  color: var(--color-brass-soft);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--color-text-soft);
  margin-top: var(--space-sm);
}

.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-brass);
  display: inline-block;
}

.article-body {
  max-width: 720px;
}

.article-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-sm);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body p {
  font-size: 16px;
  line-height: 1.95;
  color: var(--color-text-soft);
  margin-bottom: var(--space-md);
}

.article-body ul {
  margin: 0 0 var(--space-md);
  padding-left: 1.2em;
  color: var(--color-text-soft);
  font-size: 16px;
  line-height: 1.9;
}

.article-body li {
  margin-bottom: var(--space-2xs);
}

.article-body strong {
  color: var(--color-ivory);
}

.article-figure {
  margin: 0 0 var(--space-xl);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-line);
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.article-footer-nav {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-line);
}

/* ===== Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0ms !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .divider-row .row-index,
  .divider-list--stacked .row-index {
    flex-basis: auto;
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}
