/* ============================================================
   P Company · Design System v1
   Inspired by Stripe / Linear — Modern Minimal
   Based on A_geometric brand direction (sprint-91/94 inheritance)
   ============================================================ */

:root {
  /* ── Brand tokens (KB `company_docs/company_profile.md` §品牌層) ── */
  --ink:        #0F0F0F;  /* primary text / dark surfaces */
  --body:       #2D2D2D;  /* secondary text */
  --ink-soft:   #4A4A4A;  /* tertiary text */
  --ink-muted:  #8A8A8A;  /* captions / hairlines */
  --paper:      #FFFFFF;  /* background */
  --cream:      #FAF8F4;  /* subtle alt bg */
  --accent:     #7B2D8E;  /* A_geometric purple (sprint-91/94) */
  --accent-soft:#F4ECF7;  /* accent surface */
  --hairline:   #E5E5E5;  /* divider */
  --success:    #0E7C45;
  --warning:    #B45309;

  /* ── Type system ── */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                  'Helvetica Neue', 'PingFang HK', 'Microsoft YaHei', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                  'Helvetica Neue', 'PingFang HK', 'Microsoft YaHei', sans-serif;
  --font-mono:    'SF Mono', Menlo, Monaco, 'Courier New', monospace;

  /* ── Scale (modular, Stripe-inspired) ── */
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 16px;
  --fs-md:   18px;
  --fs-lg:   22px;
  --fs-xl:   28px;
  --fs-2xl:  36px;
  --fs-3xl:  48px;
  --fs-4xl:  64px;
  --fs-5xl:  84px;

  /* ── Spacing ── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;
  --sp-10: 128px;

  /* ── Layout ── */
  --container: 1200px;
  --container-narrow: 880px;
  --radius:    8px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* ── Motion ── */
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --duration:  240ms;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}
p { margin: 0; }

/* ── Container ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}
.nav-logo svg { width: 28px; height: 28px; }
.nav-links {
  display: flex; gap: var(--sp-6);
  list-style: none; padding: 0; margin: 0;
}
.nav-links a {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  transition: color var(--duration) var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--duration) var(--ease);
}
.nav-cta:hover { background: var(--body); }
@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  font-size: var(--fs-base);
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--body); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn-secondary:hover { border-color: var(--ink); background: var(--cream); }
.btn-accent { background: var(--accent); color: var(--paper); }
.btn-accent:hover { background: #6B2479; }

/* ── Hero ── */
.hero {
  position: relative;
  padding: var(--sp-10) 0 var(--sp-9);
  overflow: hidden;
}
.hero-image {
  position: absolute; inset: 0;
  z-index: -1;
}
.hero-image img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.55);
}
.hero-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,15,15,0.4) 0%, rgba(15,15,15,0.7) 100%);
}
.hero-content {
  position: relative;
  color: var(--paper);
  max-width: 760px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: var(--sp-5);
}
.hero h1 {
  font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl));
  font-weight: 600;
  line-height: 1.05;
  color: var(--paper);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-5);
}
.hero-sub {
  font-size: var(--fs-md);
  color: rgba(255,255,255,0.85);
  line-height: 1.55;
  max-width: 560px;
  margin-bottom: var(--sp-7);
}
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero-actions .btn-primary { background: var(--paper); color: var(--ink); }
.hero-actions .btn-primary:hover { background: var(--cream); }
.hero-actions .btn-secondary {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255,255,255,0.3);
}
.hero-actions .btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

/* ── Section ── */
.section {
  padding: var(--sp-9) 0;
}
.section-tight { padding: var(--sp-8) 0; }
.section-dark {
  background: var(--ink);
  color: var(--paper);
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--paper); }
.section-cream { background: var(--cream); }

.section-eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
.section-title {
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl));
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--sp-4);
  max-width: 720px;
}
.section-lede {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: var(--sp-7);
}
.section-dark .section-lede { color: rgba(255,255,255,0.7); }

/* ── Card grid ── */
.grid {
  display: grid;
  gap: var(--sp-5);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration) var(--ease);
}
.card:hover {
  border-color: var(--ink-muted);
  transform: translateY(-2px);
}
.card h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-3);
}
.card p {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.card-num {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-3);
}
.card-icon {
  display: inline-block;
  width: 28px; height: 28px;
  margin-bottom: var(--sp-4);
  color: var(--accent);
}
.card-icon svg { width: 28px; height: 28px; display: block; }

/* ── Service card ── */
.service-card {
  position: relative;
  padding: var(--sp-7);
}
.service-card > .card-icon {
  display: block;
  width: 24px; height: 24px;
  margin-bottom: var(--sp-4);
}
.service-card > .card-icon svg { width: 24px; height: 24px; }
.service-card h3 { font-size: var(--fs-xl); margin-bottom: var(--sp-3); }
.service-card .num {
  position: absolute; top: var(--sp-5); right: var(--sp-6);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.service-card .tag {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

/* ── Case card ── */
.case-card {
  overflow: hidden;
  padding: 0;
}
.case-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.case-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.case-card:hover .case-image img { transform: scale(1.04); }
.case-body { padding: var(--sp-6); }
.case-meta {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}
.case-title { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.case-desc { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ── Stats row ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-7);
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
@media (max-width: 768px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
}
.stat .num {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: block;
}
.stat .label {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-top: var(--sp-2);
}

/* ── Team grid ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-5);
}
@media (max-width: 1024px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
.team-card {
  text-align: center;
  padding: var(--sp-5);
}
.team-mascot {
  width: 88px; height: 88px;
  margin: 0 auto var(--sp-4);
}
.team-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  margin-bottom: 2px;
}
.team-role {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}
.team-desc {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ── Quote ── */
.quote {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.quote-cite {
  margin-top: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}

/* ── Footer ── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: var(--sp-9) 0 var(--sp-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer h4 {
  font-size: var(--fs-xs);
  color: var(--paper);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: var(--sp-2); }
.footer a {
  color: rgba(255,255,255,0.65);
  font-size: var(--fs-sm);
  transition: color var(--duration) var(--ease);
}
.footer a:hover { color: var(--paper); }
.footer-brand p {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.55);
  margin-top: var(--sp-3);
  max-width: 320px;
  line-height: 1.55;
}
.footer-brand .legal {
  margin-top: var(--sp-5);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--sp-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.4);
}

/* ── Form ── */
.form { display: grid; gap: var(--sp-4); }
.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: var(--sp-2);
  color: var(--ink);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: border-color var(--duration) var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }

/* ── Pill / tag ── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Hairline divider ── */
.hairline {
  height: 1px;
  background: var(--hairline);
  margin: var(--sp-7) 0;
  border: 0;
}

/* ── Logo (footer / header) ── */
.logo-mark {
  display: inline-flex; align-items: center; gap: 10px;
}
.logo-mark .mark {
  width: 32px; height: 32px;
}
.logo-mark .word {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Page header (sub-pages) ── */
.page-header {
  padding: var(--sp-9) 0 var(--sp-7);
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
}
.page-header h1 {
  font-size: clamp(var(--fs-3xl), 5vw, var(--fs-4xl));
  margin-bottom: var(--sp-3);
}
.page-header p {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  max-width: 640px;
}

/* ── Utility ── */
.text-muted { color: var(--ink-muted); }
.text-soft { color: var(--ink-soft); }
.text-accent { color: var(--accent); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }

/* ── Fade-in animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}
