/* ==========================================================================
   TRIVE — Base
   ========================================================================== */
:root {
  --color-bg: #0a0a0c;
  --color-bg-alt: #101012;
  --color-surface: #141416;
  --color-border: #2a2a2e;
  --color-border-gold: rgba(201, 169, 97, 0.35);
  --color-text: #f3efe7;
  --color-text-dim: #b8b2a6;
  --color-text-mute: #7d786e;
  --color-gold: #c9a961;
  --color-gold-light: #e3cd94;
  --gradient-gold: linear-gradient(135deg, #a9814a 0%, #e3cd94 50%, #a9814a 100%);
  --shadow-lg: 0 24px 70px -24px rgba(0, 0, 0, 0.7);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 2px;
  --ff-body: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --ff-heading: "Noto Serif JP", serif;
  --ff-accent: "Cormorant Garamond", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--ff-body);
  font-weight: 400;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul, ol { list-style: none; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, textarea, select { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

.container--narrow { max-width: 720px; }

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Scroll progress indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--gradient-gold);
  z-index: 200;
  transition: width .1s linear;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: 2px;
  font-family: var(--ff-body);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  position: relative;
  overflow: hidden;
  background: var(--gradient-gold);
  color: #0a0a0c;
}
.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: left .6s var(--ease);
}
.btn--primary:hover { box-shadow: var(--shadow-lg); }
.btn--primary:hover::before { left: 130%; }

.btn--ghost,
.btn--outline {
  position: relative;
  overflow: hidden;
  z-index: 0;
}
.btn--ghost::before,
.btn--outline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(201, 169, 97, 0.1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
  z-index: -1;
}
.btn--ghost:hover::before,
.btn--outline:hover::before { transform: scaleX(1); }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border-gold);
  color: var(--color-text);
}
.btn--ghost:hover { border-color: var(--color-gold); color: var(--color-gold-light); }

.btn--outline {
  border: 1px solid var(--color-border-gold);
  color: var(--color-text);
  width: 100%;
}
.btn--outline:hover { border-color: var(--color-gold); color: var(--color-gold-light); }

.btn--block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 26px;
  transition: padding .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  padding-block: 16px;
  background: rgba(10, 10, 12, 0.9);
  backdrop-filter: blur(14px);
  border-color: var(--color-border);
}

.header__inner { display: flex; align-items: center; justify-content: space-between; }

.logo {
  font-family: var(--ff-heading);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  transition: letter-spacing .3s var(--ease);
}
.logo:hover { letter-spacing: 0.05em; }
.logo__sub {
  font-family: var(--ff-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--color-text-dim);
  margin-top: 4px;
}

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

.nav__link {
  position: relative;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--color-text-dim);
  padding-bottom: 4px;
  transition: color .2s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width .3s var(--ease);
}
.nav__link:hover,
.nav__link.is-active { color: var(--color-gold-light); }
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}
.menu-btn span {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--color-text);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 200px 0 120px;
  overflow: hidden;
}

.hero__bg { position: absolute; inset: 0; z-index: 0; }

.hero__frame {
  position: absolute;
  top: 120px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  border: 1px solid var(--color-border-gold);
  pointer-events: none;
}

.hero__inner { position: relative; z-index: 1; text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--color-gold);
  margin-bottom: 28px;
  padding-bottom: 14px;
  position: relative;
}
.eyebrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: 40px;
  height: 1px;
  background: var(--color-gold);
}

.hero__title {
  font-family: var(--ff-heading);
  font-size: clamp(2.2rem, 5.2vw, 3.8rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.03em;
  max-width: 900px;
  margin-inline: auto;
}
.hero__title-accent { color: var(--color-gold-light); }

.hero__desc {
  max-width: 640px;
  margin: 32px auto 0;
  color: var(--color-text-dim);
  font-size: 0.98rem;
  font-weight: 400;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero__actions .btn { min-width: 216px; }

.hero__pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 780px;
  margin: 88px auto 0;
  padding-top: 44px;
  border-top: 1px solid var(--color-border);
}
.hero__pillars li {
  font-family: var(--ff-heading);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-dim);
}
.hero__pillar-num {
  display: block;
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--color-gold);
  margin-bottom: 10px;
}

/* ==========================================================================
   Sections (generic)
   ========================================================================== */
.section { padding: 140px 0; }
.section--alt { background: var(--color-bg-alt); }

.section__eyebrow {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--color-gold);
  margin-bottom: 18px;
}
.section__title {
  text-align: center;
  font-family: var(--ff-heading);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.section__desc {
  text-align: center;
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--color-text-dim);
  font-weight: 400;
  text-wrap: pretty;
}

.section__eyebrow--left { text-align: left; }
.section__title--left { text-align: left; }

/* ==========================================================================
   About
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: start;
}
.about__quote {
  font-family: var(--ff-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-gold-light);
  line-height: 1.6;
  margin-bottom: 28px;
}
.about__text {
  color: var(--color-text-dim);
  font-weight: 400;
  font-size: 0.98rem;
  text-wrap: pretty;
}

/* ==========================================================================
   Business rows
   ========================================================================== */
.business-list { margin-top: 72px; display: flex; flex-direction: column; gap: 108px; }

.business-row {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: center;
}
.business-row--reverse { direction: rtl; }
.business-row--reverse > * { direction: ltr; }

.business-row__media { position: relative; }
.business-row__frame {
  position: absolute;
  inset: -16px -16px auto auto;
  top: 16px;
  right: -16px;
  bottom: -16px;
  left: 16px;
  border: 1px solid var(--color-border-gold);
  z-index: 0;
  transition: top .4s var(--ease), left .4s var(--ease);
}
.business-row:hover .business-row__frame { top: 10px; left: 10px; }
.business-row__thumb {
  position: relative;
  z-index: 1;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.business-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(85%) contrast(1.02) brightness(1.03);
  transition: transform .6s var(--ease), filter .5s var(--ease);
}
.business-row:hover .business-row__thumb img {
  transform: scale(1.06);
  filter: saturate(100%) contrast(1.02) brightness(1.06);
}
.business-row__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0) 72%, rgba(10, 10, 12, 0.5) 100%);
  z-index: 1;
  pointer-events: none;
}
.business-row__thumb-num {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  left: 20px;
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: 1.9rem;
  color: var(--color-gold-light);
}

.business-row__label {
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-gold);
  margin-bottom: 10px;
}
.business-row__title {
  font-family: var(--ff-heading);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.business-row__desc {
  color: var(--color-text-dim);
  font-weight: 400;
  font-size: 0.94rem;
  margin-bottom: 24px;
  text-wrap: pretty;
}
.business-row__points li {
  font-size: 0.88rem;
  color: var(--color-text-dim);
  padding-left: 22px;
  position: relative;
  margin-bottom: 12px;
}
.business-row__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 1px;
  background: var(--color-gold);
}

.business-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}
.business-row__tags li {
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--color-text-mute);
  border: 1px solid var(--color-border-gold);
  padding: 7px 16px;
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}
.business-row__tags li:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  background: rgba(201, 169, 97, 0.06);
}

/* ==========================================================================
   Cards (strengths)
   ========================================================================== */
.cards {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}
.card {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-alt);
  padding: 40px 30px;
  transition: background .3s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.card:hover { background: var(--color-surface); }
.card:hover::before { transform: scaleX(1); }
.card__icon {
  font-size: 1.1rem;
  color: var(--color-gold);
  margin-bottom: 22px;
  display: inline-block;
  transition: transform .35s var(--ease), color .35s var(--ease);
}
.card:hover .card__icon { transform: scale(1.15) rotate(8deg); color: var(--color-gold-light); }
.card__title { font-family: var(--ff-heading); font-size: 1.02rem; font-weight: 600; margin-bottom: 14px; }
.card__desc { font-size: 0.86rem; color: var(--color-text-dim); font-weight: 400; text-wrap: pretty; }

/* ==========================================================================
   Company overview table
   ========================================================================== */
.company-table { margin-top: 56px; border-top: 1px solid var(--color-border); }
.company-table__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}
.company-table__row dt {
  font-family: var(--ff-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gold-light);
}
.company-table__row dd {
  font-size: 0.92rem;
  color: var(--color-text-dim);
  font-weight: 400;
}

/* ==========================================================================
   Contact form
   ========================================================================== */
.form { margin-top: 56px; }
.form__row { margin-bottom: 26px; }
.form__row label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--color-text-dim);
}
.required {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-gold);
  border: 1px solid var(--color-border-gold);
  padding: 2px 8px;
  margin-left: 6px;
}
.form__row input,
.form__row select,
.form__row textarea {
  width: 100%;
  padding: 15px 18px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  transition: border-color .2s var(--ease);
}
.form__row input:focus,
.form__row select:focus,
.form__row textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.12);
}
.form__row input::placeholder,
.form__row textarea::placeholder {
  color: var(--color-text-mute);
  opacity: 1;
}
.form__row select option {
  background: var(--color-surface);
  color: var(--color-text);
}
.form__row input:-webkit-autofill,
.form__row input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text);
  box-shadow: 0 0 0 1000px var(--color-surface) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.form__row textarea { resize: vertical; min-height: 120px; }
.form__error {
  font-size: 0.78rem;
  color: #e0937a;
  margin-top: 8px;
  min-height: 1em;
}
.form__note {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-gold-light);
  min-height: 1.2em;
}
.form__row input.is-invalid,
.form__row textarea.is-invalid { border-color: #e0937a; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { padding: 80px 0 32px; }
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 52px;
}
.logo--footer { font-size: 1.4rem; }
.footer__desc { margin-top: 14px; font-size: 0.84rem; color: var(--color-text-mute); white-space: nowrap; font-weight: 400; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 28px; }
.footer__nav a { font-size: 0.84rem; color: var(--color-text-dim); }
.footer__nav a:hover { color: var(--color-gold-light); }
.footer__copy {
  font-size: 0.74rem;
  color: var(--color-text-mute);
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Back to top
   ========================================================================== */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border-gold);
  background: rgba(10,10,12,0.9);
  color: var(--color-gold);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), border-color .2s var(--ease);
  z-index: 90;
  backdrop-filter: blur(8px);
}
.to-top:hover { border-color: var(--color-gold); background: rgba(201, 169, 97, 0.1); color: var(--color-gold-light); }
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .nav { position: fixed; inset: 0; top: 0; height: 100vh; background: rgba(10,10,12,0.98); backdrop-filter: blur(10px); flex-direction: column; justify-content: center; gap: 32px; transform: translateX(100%); transition: transform .35s var(--ease); }
  .nav.is-open { transform: translateX(0); }
  .nav__link { font-size: 1.2rem; }
  .menu-btn { display: flex; z-index: 101; }

  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero__pillars { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .business-row,
  .business-row--reverse { grid-template-columns: 1fr; direction: ltr; }
  .company-table__row { grid-template-columns: 120px 1fr; }
}

@media (max-width: 760px) {
  .hero { padding-top: 160px; }
  .hero__frame { top: 100px; left: 20px; right: 20px; bottom: 20px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__pillars { grid-template-columns: 1fr; text-align: left; }

  .cards { grid-template-columns: 1fr; }
  .company-table__row { grid-template-columns: 1fr; gap: 8px; }
  .footer__inner { flex-direction: column; }
  .footer__desc { white-space: normal; max-width: 400px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
