/* =========================================================
   to be — base.css
   Reset / Tokens / Typography / Utilities
   ========================================================= */

/* ---------- Modern reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: auto; /* Lenis controls smooth scroll */
}

body {
  min-height: 100vh;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

/* ---------- Design tokens ---------- */
:root {
  /* Color */
  --bg: #0a0a0a;
  --bg-2: #111111;
  --fg: #ffffff;
  --mute: #9a9a9a;
  --line: #1f1f1f;
  --line-strong: #2a2a2a;
  --invert-bg: #f4f4f4;
  --invert-fg: #0a0a0a;

  /* Typography */
  --font-sans: "Helvetica Neue", "Helvetica", Arial, "Noto Sans JP",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-jp: "Noto Sans JP", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

  /* Fluid type */
  --fs-hero: clamp(42px, 9vw, 120px);
  --fs-display: clamp(28px, 6vw, 72px);
  --fs-h1: clamp(32px, 4.5vw, 64px);
  --fs-h2: clamp(24px, 3vw, 40px);
  --fs-h3: clamp(20px, 2vw, 28px);
  --fs-body: clamp(15px, 1.05vw, 17px);
  --fs-small: 13px;
  --fs-eyebrow: 12px;

  /* Layout */
  --gutter: 6vw;
  --section-y: clamp(80px, 12vw, 160px);
  --maxw: 1440px;
  --radius: 2px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.3s;
  --dur: 0.6s;
  --dur-slow: 1.2s;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5 {
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}

p {
  font-size: var(--fs-body);
  line-height: 1.85;
  color: var(--mute);
  font-family: var(--font-jp);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--mute);
}

.display {
  font-size: var(--fs-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.hero-copy {
  font-size: var(--fs-hero);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  font-family: var(--font-jp);
}

.lead {
  font-size: clamp(16px, 1.2vw, 18px);
  color: var(--mute);
  /* max-width: 56ch; */
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--invert {
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.section--invert p,
.section--invert .eyebrow {
  color: #555;
}

.section--invert .eyebrow::before {
  background: #555;
}

.grid {
  display: grid;
  gap: clamp(24px, 3vw, 48px);
}

.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-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-fg: var(--fg);
  --btn-bg: transparent;
  --btn-border: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn .arrow {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur) var(--ease-out);
}

.btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn:hover .arrow {
  transform: translateX(4px);
}

.btn--solid {
  --btn-fg: var(--bg);
  --btn-bg: var(--fg);
}

.btn--solid:hover {
  background: transparent;
  color: var(--fg);
}

.section--invert .btn {
  --btn-fg: var(--invert-fg);
  --btn-border: var(--invert-fg);
}
.section--invert .btn:hover {
  background: var(--invert-fg);
  color: var(--invert-bg);
}

/* ---------- Reveal helpers (will be activated by JS) ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(60px);
  will-change: transform, opacity;
}

.clip-reveal {
  clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}

.char {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}

/* ---------- Noise overlay ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ---------- Custom cursor ---------- */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor,
  html.has-cursor body {
    cursor: none;
  }

  html.has-cursor a,
  html.has-cursor button,
  html.has-cursor .btn,
  html.has-cursor input,
  html.has-cursor textarea,
  html.has-cursor select {
    cursor: none;
  }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  .cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--fg);
    border-radius: 50%;
    mix-blend-mode: difference;
  }

  .cursor-ring {
    width: 36px;
    height: 36px;
    border: 1px solid var(--fg);
    border-radius: 50%;
    mix-blend-mode: difference;
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
      opacity 0.25s var(--ease-out);
  }

  html.cursor-hover .cursor-ring {
    width: 64px;
    height: 64px;
    opacity: 0.7;
  }
}

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-up,
  .char {
    opacity: 1 !important;
    transform: none !important;
  }

  .clip-reveal {
    clip-path: none !important;
  }
}

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}
