/* kakesa.net — hand-written, embedded in the binary, no build step.
 *
 * Roughly 200 lines covers the whole site. Dark and light are both first-class
 * via prefers-color-scheme (the Svelte version hardcoded h1 { color: #000 }
 * and had no dark mode at all).
 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-hover: #f0f2f5;
  --border: #dfe3e8;
  --text: #14181f;
  --text-muted: #5b6472;
  --accent: #1f6feb;
  --accent-contrast: #ffffff;
  --status: #1a7f37;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 8%);
  --focus: 0 0 0 3px rgb(31 111 235 / 45%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-hover: #1f262e;
    --border: #2b333c;
    --text: #e6edf3;
    --text-muted: #9aa7b4;
    --accent: #4c8dff;
    --accent-contrast: #06101f;
    --status: #3fb950;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 45%);
    --focus: 0 0 0 3px rgb(76 141 255 / 50%);
  }
}

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

body {
  margin: 0;
  padding: clamp(1rem, 4vw, 2.5rem) 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 5vw, 2rem);
}

/* --- Header ------------------------------------------------------------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.profile h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.5rem, 6vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.profile-compact h1 {
  margin-top: 0;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 26rem;
}

.avatar {
  position: relative;
  width: 96px;
  height: 96px;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 2px solid var(--border);
}

/* The availability dot. It carries an aria-label, so it is a real piece of
 * information rather than colour-only decoration. */
.avatar-status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--status);
  border: 2px solid var(--surface);
}

/* --- Sections ----------------------------------------------------------- */

.section {
  margin-top: 2rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.links,
.links-list {
  margin-top: 1.5rem;
}

.links ul,
.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- Buttons (anchors, not nested <button> elements) -------------------- */

.btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  /* 44px minimum touch target. */
  min-height: 3rem;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus);
  border-color: var(--accent);
}

.btn-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.btn-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-detail {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.btn-external {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.6;
}

.btn-external .icon {
  width: 15px;
  height: 15px;
}

.btn:hover .btn-external,
.btn:focus-visible .btn-external {
  opacity: 1;
  color: var(--accent);
}

/* --- Skills ------------------------------------------------------------- */

.skills {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.skills h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

/* A real list, centred by nothing: the Svelte version pushed this content into
 * a 4-of-12 column offset 6 columns right, which squeezed it off-centre and
 * overflowed on phones. */
.skills ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.skills li + li {
  margin-top: 0.25rem;
}

/* --- Utilities ---------------------------------------------------------- */

.footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer p {
  margin: 0;
}

.back {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
}

.back a,
.footer a {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 8px;
}

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