/* ==================================================== */
/* Smart-CV — Swiss / Editorial design system (shared)   */
/* Tokens + shell primitives (masthead, footer, buttons, */
/* links, account, section heads, motion). Consumed by    */
/* every Next.js page; page-specific CSS builds on top.   */
/* Wrapper class: `.sw-app`. Motion is progressive         */
/* enhancement — the `.sw-motion` class is added by JS.    */
/* ==================================================== */
:root {
  --sw-paper: #f4f5f6;
  --sw-surface: #ffffff;
  --sw-ink: #15181b;
  --sw-ink-2: #454d52;
  --sw-ink-3: #7b8388;
  --sw-line: #e2e5e8;
  --sw-line-strong: #c7ccd0;
  --sw-accent: #0c9959;          /* vivid emerald — brighter/more saturated, still text-safe on white */
  --sw-accent-bright: #00e28a;   /* genuinely fluorescent spring-green — fills, glows, focus rings (pair with dark text, not white) */
  --sw-accent-deep: #073f30;     /* pressed/hover shade for accent-colored surfaces (buttons) */
  --sw-accent-soft: rgba(12, 153, 89, 0.08);
  --sw-danger: #a5352a;

  /* Flat neutral-gray elevation — the app's real "card lifted off the
     page" language (used by .panel/.history-item/.wizard-card). Home
     used to hand-roll colored emerald glows instead; this brings it
     in line with every other surface. */
  --sw-shadow-card: 0 1px 2px rgba(21, 24, 27, 0.05), 0 12px 30px -18px rgba(21, 24, 27, 0.18);
  --sw-shadow-card-hover: 0 2px 4px rgba(21, 24, 27, 0.06), 0 18px 40px -20px rgba(21, 24, 27, 0.24);

  --sw-font-serif: 'Noto Serif JP', 'Noto Sans JP', serif;
  --sw-font-sans: 'Noto Sans JP', system-ui, sans-serif;
  --sw-font-mono: 'DM Mono', 'Roboto Mono', ui-monospace, 'SFMono-Regular', monospace;
  /* Serif wordmark (was Poppins/geometric-sans — read as generic SaaS).
     Propagates to every masthead, footer mark, and editor header. */
  --sw-font-logo: 'Noto Serif JP', 'Noto Sans JP', serif;

  /* Fluid, not a hard cap — on large monitors a fixed 1120px left huge
     dead margins on both sides. Grows with the viewport up to 1440px;
     text-bearing elements (hero lead, history desc, etc.) keep their
     own ch-based max-width, so this only affects overall breathing
     room, never line length. */
  --sw-wrap: clamp(1120px, 80vw, 1440px);
  --sw-gutter: clamp(1.25rem, 5vw, 4rem);
  --sw-dur: 260ms;
  --sw-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sw-font-sans);
  background: var(--sw-paper);
  color: var(--sw-ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sw-app a { text-decoration: none; color: inherit; }
.sw-app img { display: block; max-width: 100%; }

/* ---------------- Shell container ---------------- */
.sw-main {
  width: 100%;
  max-width: var(--sw-wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--sw-gutter) clamp(4rem, 8vw, 7rem);
}

/* ---------------- Masthead ---------------- */
.sw-masthead {
  border-bottom: 1px solid var(--sw-line-strong);
  background: var(--sw-surface);
}

.sw-masthead-inner {
  max-width: var(--sw-wrap);
  margin: 0 auto;
  padding: 1.35rem var(--sw-gutter);
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.sw-logo {
  position: relative;
  font-family: var(--sw-font-logo);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  padding-bottom: 3px;
}

.sw-logo .smart { color: var(--sw-ink); }
.sw-logo .dash  { color: var(--sw-ink-3); margin: 0 2px; font-weight: 500; }
/* Brighter than the shared --sw-accent (which stays put — it's also
   used for small body-sized text elsewhere, and can't go much
   lighter without losing AA contrast there). The logo is large, bold
   display type, so it can carry a lighter, more vivid green and
   still read clearly against the white masthead. */
.sw-logo .cv    { color: #0ea563; }

/* Quiet hairline reveal on hover/focus — reuses the site's existing
   underline-grow vocabulary (see .sw-link) instead of inventing a new one. */
.sw-logo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sw-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 360ms var(--sw-ease);
}
.sw-logo:hover::after,
.sw-logo:focus-visible::after { transform: scaleX(1); }

.sw-tag {
  font-size: 0.82rem;
  color: var(--sw-ink-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sw-account {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.85rem;
}

.sw-account-muted { color: var(--sw-ink-3); }
.sw-account-email { color: var(--sw-ink-2); }

.sw-account-button {
  font-family: var(--sw-font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sw-ink-2);
  background: #f8fafc;
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  box-shadow: 0 1px 2px rgba(21, 24, 27, 0.04);
  cursor: pointer;
  transition: background var(--sw-dur) var(--sw-ease),
              border-color var(--sw-dur) var(--sw-ease),
              color var(--sw-dur) var(--sw-ease),
              transform var(--sw-dur) var(--sw-ease),
              box-shadow var(--sw-dur) var(--sw-ease);
}

.sw-account-button:hover:not(:disabled) {
  background: #2cddb4;
  border-color: #2cddb4;
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(44, 221, 180, 0.7);
  transform: translateY(-1px);
}

.sw-account-button:disabled { opacity: 0.55; cursor: default; }

/* ---------------- Focus ring (shared) ---------------- */
.sw-account-button:focus-visible,
.sw-btn:focus-visible,
.sw-link:focus-visible {
  outline: 2px solid var(--sw-accent);
  outline-offset: 3px;
}

/* ---------------- Eyebrow + section head ---------------- */
.sw-eyebrow {
  margin: 0 0 1.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sw-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.sw-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--sw-accent);
}

.sw-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  flex-wrap: wrap;
}

.sw-section-title {
  margin: 0;
  font-family: var(--sw-font-serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  color: var(--sw-ink);
}

.sw-section-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sw-ink-3);
}

/* ---------------- Buttons + links ---------------- */
/* Primary CTA: dark-emerald label on the fluorescent fill, not white on
   dark. White-on-bright-green would wash out (a bright fill can't hold
   AA contrast for light text) — dark text on the bright fill is both
   the readable choice and the more deliberate, considered-looking one.
   A soft top highlight plus a colored glow shadow reads as one crafted
   surface rather than a flat color swatch. */
.sw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--sw-font-sans);
  font-weight: 700;
  font-size: 1rem;
  color: var(--sw-accent-deep);
  background: var(--sw-accent-bright);
  border: 1px solid var(--sw-accent-bright);
  padding: 1.05rem 2.1rem;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 28px -12px rgba(0, 226, 138, 0.55);
  transition: background var(--sw-dur) var(--sw-ease),
              border-color var(--sw-dur) var(--sw-ease),
              box-shadow var(--sw-dur) var(--sw-ease),
              transform 140ms var(--sw-ease);
}

.sw-btn .sw-arrow { color: var(--sw-accent-deep); }
.sw-btn:hover {
  background: #00c67a;
  border-color: #00c67a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 20px 34px -12px rgba(0, 198, 122, 0.6);
  transform: scale(1.015);
}
.sw-btn:hover .sw-arrow { transform: translateX(4px); }
/* Press feedback via scale, not translateY — nothing in this button's
   material actually moves down when pressed, it compresses. */
.sw-btn:active { transform: scale(0.97); }
.sw-btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; transform: none; }
.sw-btn:disabled:hover { background: var(--sw-accent-bright); border-color: var(--sw-accent-bright); }

/* Inline underline link (grows on hover) */
.sw-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sw-ink);
  padding-bottom: 3px;
  background-image: linear-gradient(var(--sw-accent-bright), var(--sw-accent-bright));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size var(--sw-dur) var(--sw-ease);
}
.sw-link:hover { background-size: 100% 2px; }
.sw-link .sw-arrow { color: var(--sw-accent); }

/* Specificity guard: `.sw-app a { color: inherit }` would otherwise
   override the light label on the dark primary button. */
.sw-app a.sw-btn { color: var(--sw-accent-deep); }
.sw-app a.sw-link { color: var(--sw-ink); }
.sw-app a.sw-hero-alt { color: rgba(255, 255, 255, 0.7); }

.sw-arrow {
  color: var(--sw-accent);
  font-size: 1.05em;
  line-height: 1;
  transition: transform var(--sw-dur) var(--sw-ease);
}

/* ---------------- Footer ---------------- */
.sw-footer {
  border-top: 1px solid var(--sw-line);
  background: var(--sw-surface);
}

.sw-footer-inner {
  max-width: var(--sw-wrap);
  margin: 0 auto;
  width: 100%;
  padding: 1.6rem var(--sw-gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sw-footer-mark {
  font-family: var(--sw-font-logo);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--sw-ink-2);
}

.sw-footer-copy { margin: 0; font-size: 0.75rem; color: var(--sw-ink-3); }

/* ---------------- Reveal on load (progressive) ---------------- */
.sw-motion [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--sw-ease), transform 0.7s var(--sw-ease);
}
.sw-motion [data-reveal].in { opacity: 1; transform: none; }

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .sw-app * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .sw-motion [data-reveal] { opacity: 1 !important; transform: none !important; }
}
