/*
  OKLCH × Japanese Traditional Colors
  Static portfolio demo for eringo.io
  No framework, no build step.
*/

:root {
  color-scheme: light;
  --bg: oklch(0.98 0.008 240);
  --surface-1: oklch(0.95 0.016 240);
  --surface-2: oklch(0.92 0.024 240);
  --border-weak: oklch(0.85 0.032 240);
  --border-strong: oklch(0.65 0.04 240);
  --text: oklch(0.25 0.012 240);
  --text-subtle: oklch(0.45 0.02 240);
  --primary: oklch(0.5 0.12 240);
  --primary-text: oklch(0.98 0 0);
  --success-bg: oklch(0.95 0.06 150);
  --success-text: oklch(0.35 0.08 150);
  --error-bg: oklch(0.95 0.06 15);
  --error-text: oklch(0.4 0.08 15);
  --shadow: 0 24px 70px color-mix(in oklch, var(--text) 13%, transparent);
  --shadow-soft: 0 12px 40px color-mix(in oklch, var(--text) 9%, transparent);
  --radius-xl: 2rem;
  --radius-lg: 1.35rem;
  --radius-md: 0.9rem;
  --content-max: 1180px;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans JP", sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", Georgia, serif;
}

html[data-theme="sumi"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 20% 0%, color-mix(in oklch, var(--primary) 12%, transparent), transparent 34rem),
    radial-gradient(circle at 90% 18%, color-mix(in oklch, var(--primary) 8%, transparent), transparent 28rem),
    var(--bg);
  color: var(--text);
  transition: background-color 450ms ease, color 450ms ease;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  inset: 1rem auto auto 1rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  overflow: hidden;
}

.site-nav {
  width: min(calc(100% - 2rem), var(--content-max));
  margin: 1rem auto 0;
  padding: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-weak);
  border-radius: 999px;
  background: color-mix(in oklch, var(--surface-1) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 1rem;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 1rem;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  box-shadow: inset 0 0 0 1px color-mix(in oklch, white 28%, transparent);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.18rem;
  color: var(--text-subtle);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-subtle);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-links a {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-links .nav-cta {
  background: var(--text);
  color: var(--bg);
}

.icon-button {
  width: 2.65rem;
  height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  transition: background-color 180ms ease, color 180ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--surface-2);
  color: var(--text);
}

.icon-button svg {
  width: 1.2rem;
  height: 1.2rem;
}

.lang-switcher {
  position: relative;
}

.lang-toggle[aria-expanded="true"] {
  color: var(--primary);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 40;
  min-width: 10.5rem;
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--surface-1) 96%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu li {
  cursor: pointer;
  padding: 0.62rem 0.75rem;
  border-radius: 0.65rem;
  outline: none;
  color: var(--text-subtle);
  line-height: 1.35;
}

.lang-menu li[aria-selected="true"] {
  color: var(--text);
  border-left: 2px solid currentColor;
}

.lang-menu li:hover,
.lang-menu li:focus-visible {
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
}

.section-pad {
  width: min(calc(100% - 2rem), var(--content-max));
  margin-inline: auto;
  padding-block: clamp(4rem, 7vw, 7rem);
}

.hero {
  position: relative;
  min-height: 610px;
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.56;
  pointer-events: none;
}

.hero-glow-a {
  width: 18rem;
  height: 18rem;
  left: -7rem;
  top: 5rem;
  background: color-mix(in oklch, var(--primary) 28%, transparent);
}

.hero-glow-b {
  width: 22rem;
  height: 22rem;
  right: -8rem;
  bottom: 4rem;
  background: color-mix(in oklch, var(--primary) 16%, transparent);
}

.eyebrow,
.kicker {
  margin: 0 0 1.2rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 900;
  font-size: 0.76rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border-weak);
  border-radius: 999px;
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
}

.icon-dot {
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.hero h1,
.section-heading h2,
.cta-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.hero h1 {
  font-size: clamp(3.7rem, 10vw, 8.2rem);
  line-height: 0.92;
}

.hero h1 em {
  color: var(--primary);
  font-style: italic;
}

.hero-copy {
  max-width: 760px;
  margin: 1.7rem auto 0;
  color: var(--text-subtle);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.75;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.03;
}

.section-heading p:last-child {
  color: var(--text-subtle);
  line-height: 1.8;
  font-size: 1.02rem;
}

.card {
  border: 1px solid var(--border-weak);
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
  transition: background-color 450ms ease, border-color 450ms ease, color 450ms ease, box-shadow 450ms ease;
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.7fr);
  gap: 1.6rem;
  align-items: stretch;
}

.control-panel,
.preview-stage {
  border-radius: var(--radius-xl);
}

.control-panel {
  padding: clamp(1.2rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.28rem;
  border: 1px solid var(--border-strong);
  border-radius: 1rem;
}

.segmented-button {
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.72rem;
  background: transparent;
  color: var(--text-subtle);
  font-size: 0.9rem;
  font-weight: 900;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.segmented-button svg {
  width: 1rem;
  height: 1rem;
}

.segmented-button.is-active {
  background: var(--text);
  color: var(--bg);
}

.control-group {
  display: grid;
  gap: 0.85rem;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.control-label-row label,
.control-label-row output {
  font-weight: 900;
  font-size: 0.88rem;
}

.control-label-row label span {
  color: var(--text-subtle);
  font-weight: 700;
}

.control-label-row output {
  padding: 0.35rem 0.55rem;
  border-radius: 0.55rem;
  background: var(--surface-2);
  color: var(--text-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.motif-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.motif-button {
  padding: 0.85rem 0.4rem;
  border: 2px solid var(--border-weak);
  border-radius: 1rem;
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 0.4rem;
  font-weight: 900;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  opacity: 0.72;
}

.motif-button:hover,
.motif-button.is-active {
  opacity: 1;
}

.motif-button.is-active {
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px color-mix(in oklch, var(--primary) 20%, transparent);
}

.motif-swatch {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--motif-color);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, white 45%, transparent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.range-caption {
  display: flex;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 0.76rem;
  font-weight: 700;
}

.preview-stage {
  padding: clamp(1.2rem, 4vw, 3rem);
  display: grid;
  align-content: center;
  gap: 1.1rem;
  background: color-mix(in oklch, var(--bg) 78%, var(--surface-1));
  box-shadow: var(--shadow);
}

.preview-card {
  max-width: 590px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
}

.preview-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.35rem;
}

.preview-card h3 {
  margin: 0.1rem 0 0.25rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.preview-card p,
.inner-surface span,
.notice span {
  color: var(--text-subtle);
  line-height: 1.6;
}

.mini-label {
  margin: 0;
  color: var(--primary) !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  font-size: 0.72rem;
}

.preview-icon {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 1.35rem;
}

.inner-surface {
  display: grid;
  gap: 0.2rem;
  padding: 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  margin-bottom: 1.2rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.primary-action,
.secondary-action,
.cta-button {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  padding: 0.85rem 1.2rem;
  font-weight: 950;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.primary-action:hover,
.secondary-action:hover,
.cta-button:hover {
  transform: translateY(-2px);
}

.primary-action {
  flex: 1 1 180px;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 14px 30px color-mix(in oklch, var(--primary) 26%, transparent);
}

.secondary-action {
  flex: 1 1 150px;
  border: 2px solid var(--border-strong);
  background: transparent;
  color: var(--text);
}

.notice-list {
  width: min(100%, 590px);
  margin-inline: auto;
  display: grid;
  gap: 0.8rem;
}

.notice {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid currentColor;
}

.notice svg {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
}

.notice strong,
.notice span {
  display: block;
}

.notice strong {
  margin-bottom: 0.15rem;
}

.notice-success {
  color: var(--success-text);
  background: var(--success-bg);
}

.notice-error {
  color: var(--error-text);
  background: var(--error-bg);
}

.library-toolbar {
  padding: 0.85rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-box {
  position: relative;
  flex: 1 1 280px;
  max-width: 390px;
}

.search-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.85rem;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.search-box input:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--primary) 22%, transparent);
}

.filter-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-weak);
  border-radius: 0.7rem;
  background: transparent;
  color: var(--text-subtle);
  font-weight: 900;
  font-size: 0.78rem;
  white-space: nowrap;
}

.filter-button.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.color-card {
  min-height: 9.5rem;
  border: 1px solid var(--border-weak);
  border-radius: 1.15rem;
  overflow: hidden;
  background: var(--surface-1);
  color: var(--text);
  text-align: left;
  box-shadow: 0 0 0 transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.color-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.color-sample {
  height: 4.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.65rem;
  color: white;
}

.copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in oklch, black 32%, transparent);
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.color-card:hover .copy-pill,
.color-card:focus-visible .copy-pill {
  opacity: 1;
  transform: translateY(0);
}

.copy-pill svg {
  width: 0.88rem;
  height: 0.88rem;
}

.color-meta {
  padding: 0.9rem;
}

.color-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.color-kanji {
  font-size: 1.25rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.color-romaji {
  color: var(--text-subtle);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.11em;
}

.color-value {
  display: block;
  color: var(--text-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 4rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-subtle);
}

.cta-wrap {
  padding-top: 2rem;
}

.cta-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4rem);
  border-radius: clamp(2rem, 5vw, 3.3rem);
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-card::before,
.cta-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  opacity: 0.12;
}

.cta-card::before {
  width: 24rem;
  height: 24rem;
  left: -12rem;
  bottom: -14rem;
  background: var(--primary);
}

.cta-card::after {
  width: 20rem;
  height: 20rem;
  right: -11rem;
  top: -10rem;
  background: var(--text);
}

.cta-orb {
  width: 4.3rem;
  height: 4.3rem;
  margin: 0 auto 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 1.25rem;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 16px 36px color-mix(in oklch, var(--primary) 30%, transparent);
  font-size: 1.75rem;
}

.cta-card h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

.cta-card p {
  max-width: 640px;
  margin: 1.2rem auto 1.8rem;
  color: var(--text-subtle);
  font-size: 1.08rem;
  line-height: 1.75;
}

.cta-button {
  gap: 0.5rem;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 16px 34px color-mix(in oklch, var(--primary) 25%, transparent);
}

.cta-button svg {
  width: 1.05rem;
  height: 1.05rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: oklch(0.18 0 0);
  color: white;
  box-shadow: 0 18px 45px rgb(0 0 0 / 0.28);
  transform: translateY(1rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 1.1rem;
  height: 1.1rem;
  color: oklch(0.77 0.16 150);
}

@media (max-width: 940px) {
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .color-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-nav {
    align-items: flex-start;
    border-radius: 1.5rem;
    flex-direction: column;
    position: static;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .hero {
    min-height: 520px;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    max-width: none;
  }

  .color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .section-pad {
    width: min(calc(100% - 1rem), var(--content-max));
  }

  .site-nav {
    width: min(calc(100% - 1rem), var(--content-max));
  }

  .hero h1 {
    font-size: clamp(3rem, 18vw, 4.2rem);
  }

  .motif-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-grid {
    gap: 0.7rem;
  }

  .color-card {
    min-height: 9rem;
  }
}

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