/* ============================================================================
   HANAMI — cherry blossom × cyberpunk, restrained.
   Near-black canvas, a single sakura accent, editorial serif, hairline structure.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&display=swap');

/* ---------- Tokens -------------------------------------------------------- */
:root {
  /* Canvas — near-black with a faint plum undertone */
  --bg: #08080b;
  --bg-elev: #0c0c11;

  /* Surfaces built from translucent white, not solid greys */
  --surface: rgba(255, 255, 255, 0.024);
  --surface-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);

  /* Accents — one pink, one muted violet. Used sparingly. */
  --sakura: #ff7aa2;
  --sakura-deep: #e5537f;
  --sakura-wash: rgba(255, 122, 162, 0.09);
  --sakura-line: rgba(255, 122, 162, 0.32);
  --iris: #8b7fd4;
  --mint: #5ecfa4;

  /* Text */
  --text: #f2f2f5;
  --text-2: #a5a5b0;
  --text-3: #6e6e7a;

  /* Type */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --hero: clamp(2.9rem, 1.4rem + 6vw, 6rem);
  --h2: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);

  /* Motion */
  --fast: 140ms;
  --base: 260ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;

  --maxw: 68rem;
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient: one soft sakura aurora, top-center. Nothing else. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(60% 42% at 50% -8%, rgba(255, 122, 162, 0.13), transparent 70%),
    radial-gradient(50% 38% at 88% 4%, rgba(139, 127, 212, 0.08), transparent 72%);
}

/* Fine dot grid — structure, barely visible */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(85% 65% at 50% 20%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(85% 65% at 50% 20%, #000, transparent 78%);
}

#petals { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* Whisper of grain — keeps flat surfaces from looking cheap */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(255, 122, 162, 0.26); color: #fff; }

:focus-visible { outline: 2px solid var(--sakura); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout -------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.wrap-wide { max-width: 78rem; }
.section { padding-block: clamp(3rem, 6vw, 5rem); }

/* ---------- Typography ---------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sakura);
}

.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; }
.serif-i { font-family: var(--font-display); font-style: italic; font-weight: 400; }
.accent { color: var(--sakura); }

h2.section-title {
  font-family: var(--font-display);
  font-size: var(--h2);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.lede { color: var(--text-2); font-size: 1rem; line-height: 1.75; max-width: 62ch; }
.meta { font-size: 0.8125rem; color: var(--text-3); }

/* Section header: number + title + hairline */
.sec-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.sec-head .num {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sec-head .line { flex: 1; height: 1px; background: var(--border); }

/* ---------- Surfaces ------------------------------------------------------ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: border-color var(--base) var(--ease), background var(--base) var(--ease);
}
.card:hover { border-color: var(--border-strong); }

/* Accent hairline along a card's top edge */
.card-accent::before {
  content: "";
  position: absolute;
  top: -1px; left: 1.75rem; right: 1.75rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sakura-line), transparent);
}

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  padding: 0.625rem 1.125rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; }

/* Primary: soft sakura fill, no glow */
.btn-primary {
  background: var(--sakura);
  color: #1a0a12;
  font-weight: 600;
}
.btn-primary:hover { background: #ffa0bd; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* Secondary: hairline ghost */
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.22); }

.btn-quiet {
  font-size: 0.875rem;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: color var(--fast);
}
.btn-quiet:hover { color: var(--text); }

/* ---------- Tags ---------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-2);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: all var(--fast) var(--ease);
}
.tag:hover { color: var(--text); border-color: var(--sakura-line); background: var(--sakura-wash); }

/* ---------- Header -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 11, 0.72);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  text-decoration: none;
}
.brand .glyph {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(255,122,162,0.22), rgba(139,127,212,0.14));
  border: 1px solid var(--sakura-line);
  color: var(--sakura);
  font-size: 13px;
  font-family: var(--font-display);
}
.navlinks { display: flex; align-items: center; gap: 1.75rem; }
.navlinks a {
  font-size: 0.875rem;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--fast);
}
.navlinks a:hover { color: var(--text); }
@media (max-width: 640px) { .nav-hide { display: none; } }

/* ---------- Hero ---------------------------------------------------------- */
.hero { padding-block: clamp(4rem, 10vw, 8.5rem) clamp(2.5rem, 5vw, 4rem); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--hero);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin-block: 1.25rem 1.5rem;
}
.hero h1 .em { font-style: italic; color: var(--sakura); }
.hero .role {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.1875rem);
  color: var(--text-2);
  max-width: 46ch;
}
.hero .place {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-3);
}
.hero .place svg { width: 14px; height: 14px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

/* ---------- Bento: about + skills ---------------------------------------- */
.bento { display: grid; gap: 1rem; }
@media (min-width: 900px) { .bento { grid-template-columns: 1.55fr 1fr; align-items: stretch; } }

/* ---------- Experience row ------------------------------------------------ */
.role-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; justify-content: space-between; }
.role-row h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.018em; }
.role-row .org { color: var(--sakura); font-size: 0.9375rem; margin-top: 0.125rem; }
.role-row .when {
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ---------- Form ---------------------------------------------------------- */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.4375rem;
}
.field input, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.625rem 0.8125rem;
  transition: border-color var(--fast), background var(--fast);
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--sakura-line);
  background: rgba(0, 0, 0, 0.4);
}

.form-note { border-radius: var(--r-sm); padding: 0.75rem 0.9375rem; font-size: 0.875rem; display: none; }
.form-note.ok { display: block; background: rgba(94, 207, 164, 0.08); border: 1px solid rgba(94, 207, 164, 0.28); color: var(--mint); }
.form-note.bad { display: block; background: var(--sakura-wash); border: 1px solid var(--sakura-line); color: var(--sakura); }

/* ---------- Logo marquee -------------------------------------------------- */
.marquee { padding-block: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--border); }
.marquee-mask {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: slide 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 4.5rem; padding-inline: 2.25rem; }
.marquee img {
  height: 22px; width: auto;
  filter: grayscale(1) brightness(0) invert(1);
  opacity: 0.34;
  transition: opacity var(--base) var(--ease);
}
.marquee img.tall { height: 32px; }
.marquee-group > *:hover img { opacity: 0.72; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Footer -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .wrap {
  padding-block: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer p { font-size: 0.8125rem; color: var(--text-3); }

/* ---------- Dashboard: services ------------------------------------------ */
.svc-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.svc {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.9375rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  text-decoration: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.svc:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.svc .ic {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.svc:hover .ic { color: var(--sakura); border-color: var(--sakura-line); background: var(--sakura-wash); }
.svc .ic svg { width: 16px; height: 16px; }
.svc .txt { min-width: 0; }
.svc h3 { font-size: 0.875rem; font-weight: 500; letter-spacing: -0.008em; color: var(--text); }
.svc p { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc .arrow {
  margin-left: auto;
  flex: none;
  color: var(--text-3);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.svc:hover .arrow { opacity: 1; transform: translateX(0); }
.svc .arrow svg { width: 14px; height: 14px; display: block; }

/* ---------- Dashboard: stats --------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 1.125rem 1.25rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 760px) { .stat { border-bottom: none; } .stat:last-child { border-right: none; } }
@media (max-width: 759px) {
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
}
.stat .k { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.stat .v { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 0.3125rem; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); margin-right: 0.4375rem; vertical-align: middle; }

/* ---------- Auth ---------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 25rem; }
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  background: #fff;
  color: #111114;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--fast), transform var(--fast) var(--ease);
}
.btn-google:hover { background: #ececef; transform: translateY(-1px); }
.btn-google:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.spinner {
  width: 28px; height: 28px;
  margin: 0 auto 1rem;
  border: 2px solid var(--border-strong);
  border-top-color: var(--sakura);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal -------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
