/* Nagakaze home: a personal page in ink on paper. The products bring their own colour. */

:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #121311;
  --text-secondary: #55584f;
  --text-muted: #7c7f76;
  --border: rgba(18, 19, 17, 0.1);
  --border-strong: rgba(18, 19, 17, 0.22);
  --shadow: 0 14px 34px rgba(18, 19, 17, 0.07);
  --rose: #e8435d;
  --max-w: 920px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f100f;
    --surface: #181a18;
    --text: #f1f2ee;
    --text-secondary: #a9ada3;
    --text-muted: #7e8279;
    --border: rgba(241, 242, 238, 0.1);
    --border-strong: rgba(241, 242, 238, 0.24);
    --shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    --rose: #f0526b;
  }
}

:root[data-theme="dark"] {
  --bg: #0f100f;
  --surface: #181a18;
  --text: #f1f2ee;
  --text-secondary: #a9ada3;
  --text-muted: #7e8279;
  --border: rgba(241, 242, 238, 0.1);
  --border-strong: rgba(241, 242, 238, 0.24);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  --rose: #f0526b;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.wordmark { display: inline-flex; align-items: baseline; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.wordmark .kanji { font-weight: 400; color: var(--text-muted); font-size: 14px; letter-spacing: 0.12em; }

.controls { display: flex; gap: 8px; }
.control {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; min-width: 34px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.control:hover { border-color: var(--border-strong); color: var(--text); }
.control svg { width: 16px; height: 16px; }

/* Intro */
.intro { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.intro h1 {
  margin: 0 0 20px;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.035em;
}
.intro p { margin: 0; max-width: 34em; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-secondary); line-height: 1.7; }

.links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 28px; font-size: 15px; }
.links a { display: inline-flex; align-items: center; gap: 5px; color: var(--text); border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; transition: border-color 0.18s ease; }
.links a:hover { border-color: var(--text); }
.arrow { color: var(--text-muted); font-size: 0.9em; }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.section-head a { font-size: 14px; color: var(--text-secondary); }
.section-head a:hover { color: var(--text); }

/* Work */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 22px;
  padding: 26px; min-height: 240px;
  border-radius: 22px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.card:focus-visible, .links a:focus-visible, .post:focus-visible, .control:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-icon { width: 56px; height: 56px; border-radius: 13px; border: 1px solid var(--border); background: #fff; object-fit: cover; }
.status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
.status.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #2fa86b; margin-right: 6px; vertical-align: 1px; }
.card.health .status { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 35%, transparent); }

.card h3 { margin: 0 0 6px; font-size: 1.45rem; font-weight: 650; letter-spacing: -0.02em; }
.card p { margin: 0; color: var(--text-secondary); font-size: 0.98rem; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.card:hover .card-foot { color: var(--text); }

/* Writing */
.posts { display: grid; }
.post {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: baseline;
  padding: 18px 0; border-top: 1px solid var(--border);
}
.post:first-child { border-top: 0; padding-top: 4px; }
.post-title { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; }
.post:hover .post-title { text-decoration: underline; text-underline-offset: 4px; }
.post-date { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.post-desc { grid-column: 1 / -1; margin: 0; color: var(--text-secondary); font-size: 0.94rem; max-width: 46em; }

/* Footer */
.foot { border-top: 1px solid var(--border); padding: 30px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--text-muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a:hover { color: var(--text); }

@media (max-width: 720px) {
  .work { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .post { grid-template-columns: 1fr; }
  .post-date { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .control, .links a { transition: none; }
  .card:hover { transform: none; }
}
