/* ============================================================
   nojukuramu — homepage styles
   A warm, paper-toned, typography-first layout.
   Light is the default; [data-theme="dark"] is the option.
   ============================================================ */

:root {
  /* --- paper & ink (light) --- */
  --bg:          #F4F2EC;
  --bg-tint:     #EFECE3;
  --surface:     #FAF9F5;
  --surface-2:   #F2F0E9;
  --ink:         #1F1E1C;
  --ink-soft:    #3D3B36;
  --muted:       #6E6A61;
  --faint:       #97938A;
  --line:        #E0DCD1;
  --line-strong: #CFCABC;

  /* --- accent: warm clay --- */
  --clay:        #C1613F;
  --clay-hover:  #A94F31;
  --clay-soft:   #F3E4DC;
  --clay-ink:    #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(31, 30, 28, .05);
  --shadow:    0 4px 16px -6px rgba(31, 30, 28, .14);

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --maxw:      1120px;
  --gutter:    clamp(20px, 5vw, 48px);
  --ease:      cubic-bezier(.22, 1, .36, 1);

  --serif: "Newsreader", ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:          #1B1A18;
  --bg-tint:     #201F1C;
  --surface:     #262522;
  --surface-2:   #2E2D29;
  --ink:         #F3F1EA;
  --ink-soft:    #D8D4C9;
  --muted:       #A19C90;
  --faint:       #7A756B;
  --line:        #383630;
  --line-strong: #4A4740;

  --clay:        #D9825F;
  --clay-hover:  #E89A79;
  --clay-soft:   #3A2B23;
  --clay-ink:    #1B1A18;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 4px 20px -6px rgba(0, 0, 0, .55);

  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--clay); color: var(--clay-ink); }

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

.skip-link {
  position: absolute; left: -999px; top: 12px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: .9rem;
}
.skip-link:focus { left: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.site-header.stuck { border-bottom-color: var(--line); }

.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  width: 28px; height: 28px; flex: none;
  border-radius: 8px;
  background: var(--clay);
  color: var(--clay-ink);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 17px; font-weight: 500; line-height: 1;
  padding-bottom: 2px;
}
.brand-name { font-size: 1rem; }

.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--muted);
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.ghost-btn {
  font: inherit; font-size: .875rem;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.ghost-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.ghost-btn kbd {
  font-family: var(--mono); font-size: .72rem;
  padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--faint);
}
.icon-btn { padding: 7px; width: 34px; justify-content: center; }
.theme-icon { width: 15px; height: 15px; display: block; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon,
:root:not([data-theme="dark"]) .theme-icon-moon { display: none; }

@media (max-width: 720px) {
  .site-nav { display: none; }
  .header-actions { margin-left: auto; }
  .cmd-hint-text, .ghost-btn kbd { display: none; }
  .cmd-hint { padding: 7px; width: 34px; justify-content: center; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(64px, 13vw, 132px) 0 clamp(48px, 8vw, 88px); }
.hero-inner { max-width: 780px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--clay);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6.4vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -.022em;
  margin-bottom: 24px;
  text-wrap: balance;
}
.hero-title em { font-style: italic; color: var(--clay); }

.hero-sub {
  font-size: clamp(1.05rem, 1.9vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 36px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  font: inherit; font-size: .95rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--clay); color: var(--clay-ink); }
.btn-primary:hover { background: var(--clay-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-soft); }

.hero-meta {
  margin-top: 44px;
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  font-size: .875rem; color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 15px; height: 15px; color: var(--clay); flex: none; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head { margin-bottom: 40px; max-width: 64ch; }
.section-label {
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 14px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.15; letter-spacing: -.018em;
  margin-bottom: 10px;
}
.section-sub { color: var(--muted); font-size: 1.02rem; }

/* ============================================================
   Project cards
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), background-color .2s var(--ease),
              box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card:hover,
.card:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--clay-soft);
  color: var(--clay);
}
.card-icon svg { width: 19px; height: 19px; }
.card-badge {
  margin-left: auto;
  font-size: .72rem; font-weight: 500;
  letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.card-title {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.3rem; line-height: 1.25; letter-spacing: -.01em;
  margin-bottom: 8px;
}
.card-desc { color: var(--muted); font-size: .92rem; line-height: 1.6; flex: 1; }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.card-tag {
  font-family: var(--mono); font-size: .7rem;
  color: var(--faint);
  padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--line);
}

.card-cta {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
  font-size: .875rem; font-weight: 500;
  color: var(--clay);
}
.card-cta svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.card:hover .card-cta svg { transform: translateX(3px); }

.stretch { position: absolute; inset: 0; border-radius: inherit; }

.card.soon { background: transparent; border-style: dashed; }
.card.soon .card-icon { background: var(--surface-2); color: var(--faint); }
.card.soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.card.soon .card-title { color: var(--muted); }

/* ============================================================
   Elemental Echo
   ============================================================ */
.echo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}
@media (max-width: 860px) {
  .echo-layout { grid-template-columns: 1fr; }
}

.echo-board {
  --pad-gap: 10px;
  position: relative;
  width: min(400px, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pad-gap);
  padding: var(--pad-gap);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.pad {
  border: 1px solid color-mix(in srgb, var(--pad-color) 24%, var(--line));
  background: color-mix(in srgb, var(--pad-color) 7%, var(--surface-2));
  cursor: pointer;
  position: relative;
  display: grid; place-items: center;
  padding: 16px;
  font: inherit; font-size: .76rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  color: color-mix(in srgb, var(--pad-color) 55%, var(--muted));
  transition: background-color .14s var(--ease), color .14s var(--ease),
              border-color .14s var(--ease), transform .14s var(--ease);
}
/* keep the labels out of the middle, where the start button sits */
.pad-air   { border-radius: 14px 6px 6px 6px; align-items: start; justify-items: start; }
.pad-fire  { border-radius: 6px 14px 6px 6px; align-items: start; justify-items: end; }
.pad-earth { border-radius: 6px 6px 6px 14px; align-items: end;   justify-items: start; }
.pad-water { border-radius: 6px 6px 14px 6px; align-items: end;   justify-items: end; }

.pad:hover {
  background: color-mix(in srgb, var(--pad-color) 13%, var(--surface-2));
  color: var(--pad-color);
}
.pad.lit {
  background: color-mix(in srgb, var(--pad-color) 30%, var(--surface));
  border-color: var(--pad-color);
  color: var(--pad-color);
  transform: scale(.985);
}
.pad.bad {
  background: var(--clay-soft);
  border-color: var(--clay);
  color: var(--clay);
  animation: shake .34s var(--ease);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* element hues, kept muted enough to sit inside the warm palette */
.pad-air   { --pad-color: #3E8E8A; }
.pad-fire  { --pad-color: #C1613F; }
.pad-earth { --pad-color: #6E8B47; }
.pad-water { --pad-color: #4A6FA5; }
[data-theme="dark"] .pad-air   { --pad-color: #7FCEC8; }
[data-theme="dark"] .pad-fire  { --pad-color: #E0906E; }
[data-theme="dark"] .pad-water { --pad-color: #8FB3E2; }
[data-theme="dark"] .pad-earth { --pad-color: #ACCB80; }

.echo-center {
  position: absolute; inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 34%; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid; place-items: center; gap: 2px;
  text-align: center;
  padding: 8px;
}
.echo-center .btn { padding: 8px 18px; font-size: .82rem; }
.echo-center .btn:disabled { opacity: .55; cursor: default; }
.echo-status {
  font-family: var(--mono); font-size: .66rem;
  color: var(--faint); line-height: 1.3;
}

.echo-side h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.25rem; margin-bottom: 8px;
}
.echo-side p { color: var(--muted); font-size: .92rem; margin-bottom: 22px; }
.echo-stats { display: flex; gap: 12px; }
.stat {
  flex: 1;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.stat-num {
  display: block;
  font-family: var(--serif); font-size: 1.9rem; line-height: 1;
  color: var(--ink); margin-bottom: 4px;
}
.stat-label {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(28px, 6vw, 72px);
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.about-body p { color: var(--ink-soft); margin-bottom: 16px; max-width: 58ch; }
.about-body a.inline {
  color: var(--clay); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.about-body a.inline:hover { color: var(--clay-hover); }

.principles { list-style: none; display: grid; gap: 2px; }
.principles li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.principles li:first-child { border-top: 1px solid var(--line); }
.principles svg { width: 17px; height: 17px; flex: none; margin-top: 3px; color: var(--clay); }
.principles strong { display: block; font-weight: 500; font-size: .95rem; margin-bottom: 2px; }
.principles span { color: var(--muted); font-size: .875rem; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-tint);
  padding: 44px 0 40px;
}
.footer-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: .9rem; }
.footer-links a, .linklike { color: var(--muted); transition: color .18s var(--ease); }
.footer-links a:hover, .linklike:hover { color: var(--ink); }
.linklike { font: inherit; background: none; border: none; cursor: pointer; padding: 0; }
.footer-fine { color: var(--faint); font-size: .82rem; }

/* ============================================================
   Command palette
   ============================================================ */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(60px, 14vh, 140px) 20px 20px;
}
.palette-backdrop[hidden] { display: none; }

.palette {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .35);
  overflow: hidden;
  animation: pop .18s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } }

#palette-input {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 16px 18px;
  background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid var(--line);
}
#palette-input:focus { outline: none; }
#palette-input::placeholder { color: var(--faint); }

.palette-list { list-style: none; max-height: 320px; overflow-y: auto; padding: 6px; }
.palette-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: .92rem;
}
.palette-list li.active { background: var(--surface-2); }
.palette-list .pi {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 6px; background: var(--clay-soft); color: var(--clay);
}
.palette-list .pi svg { width: 14px; height: 14px; }
.palette-list .ps { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.palette-empty { color: var(--muted); padding: 16px 12px; font-size: .9rem; }

.palette-foot {
  display: flex; gap: 14px; align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .75rem; color: var(--faint);
}
.palette-foot kbd {
  font-family: var(--mono); font-size: .7rem;
  padding: 1px 5px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--line);
}

/* ============================================================
   404
   ============================================================ */
.lost { max-width: 560px; margin: 0 auto; padding: 22vh 22px 0; }
.lost .code {
  font-family: var(--mono); font-size: .8rem;
  letter-spacing: .1em; color: var(--faint); margin-bottom: 16px;
}
.lost h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12;
  letter-spacing: -.02em; margin-bottom: 14px;
}
.lost p { color: var(--muted); margin-bottom: 30px; }
.lost .btn { margin-right: 10px; margin-bottom: 10px; }

.about-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.15; letter-spacing: -.018em;
  margin-bottom: 20px;
}
