/* Tun Bakyu — personal profile, light ivory */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #6f6a62;
  --line: #e8e3da;
  --accent: #9f2f24;
  --accent-soft: #f5ebe9;
  --max: 1040px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 248, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-dot { color: var(--accent); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 14px;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

/* Profile hero — like a GitHub / portfolio intro */
.profile-hero {
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--line);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}

.profile-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(28, 26, 23, 0.08);
}

.profile-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
}

.profile-content {
  padding-top: 8px;
}

.profile-name {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.profile-tagline {
  margin-top: 10px;
  font-size: 17px;
  color: var(--muted);
}

.profile-bio {
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
}

.profile-bio strong {
  color: var(--text);
  font-weight: 600;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(159, 47, 36, 0.1);
}

.badge.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.badge.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* About facts card */
section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.section-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-label-spaced {
  margin-top: 36px;
}

h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-intro {
  margin-top: 16px;
  font-size: 16px;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.65;
}

.about-follow {
  margin-top: 28px;
}

.about-card {
  margin-top: 28px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 26, 23, 0.04);
}

.about-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.about-list li {
  font-size: 15px;
  color: var(--muted);
  padding-left: 0;
  line-height: 1.5;
}

.about-list strong {
  color: var(--text);
  font-weight: 600;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.card:hover {
  border-color: #d8d0c4;
  box-shadow: 0 10px 28px rgba(28, 26, 23, 0.06);
}

.card-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.card-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* Work */
.work-list {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.work-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.work-item:hover {
  border-color: #d8d0c4;
  transform: translateX(4px);
}

.work-item h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
}

.work-item p {
  font-size: 14px;
  color: var(--muted);
}

.project-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.work-item-soon {
  border-style: dashed;
  opacity: 0.88;
}

.work-item-soon:hover {
  transform: none;
}

.tag-active {
  border-color: rgba(159, 47, 36, 0.25);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-done {
  border-color: rgba(60, 100, 70, 0.22);
  background: #eef5f0;
  color: #3d5c48;
}

.tag {
  display: inline-flex;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Quote */
.quote-block {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 28ch;
}

.quote-block span { color: var(--accent); }

.principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 36px;
}

.principle {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
}

.principle h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.principle p {
  font-size: 13px;
  color: var(--muted);
}

/* Contact */
.contact-box {
  margin-top: 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: end;
}

.contact-box h3 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contact-links {
  display: grid;
  gap: 8px;
}

.contact-links a {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-footer {
  padding: 36px 0 44px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Notes */
.notes-header {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--line);
}

.notes-header h1 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}

.back-link:hover { color: var(--accent); }

.notes-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
  padding: 36px 0 64px;
}

.notes-sidebar {
  position: sticky;
  top: 88px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notes-sidebar h2 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.post-list { list-style: none; }

.post-list li { margin-bottom: 2px; }

.post-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 160ms var(--ease);
}

.post-list a:hover { background: var(--accent-soft); }
.post-list .active-post a { background: var(--accent-soft); }

.post-list .post-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.post-list .post-meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.note-article {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 260px;
}

.note-article .post-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.note-article h1 {
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
}

.note-article h2 {
  font-size: 21px;
  margin-top: 28px;
  margin-bottom: 10px;
}

.note-article h3 {
  font-size: 17px;
  margin-top: 22px;
  margin-bottom: 8px;
}

.note-article p {
  margin-bottom: 14px;
  max-width: 68ch;
}

.note-article ul,
.note-article ol {
  margin-bottom: 14px;
  padding-left: 22px;
}

.note-article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-article code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg);
}

.note-article blockquote {
  margin: 18px 0;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 820px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    max-width: 360px;
  }

  .card-grid,
  .principles {
    grid-template-columns: 1fr;
  }

  .work-item {
    grid-template-columns: 1fr;
  }

  .contact-box {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .notes-layout {
    grid-template-columns: 1fr;
  }

  .notes-sidebar {
    position: static;
  }
}
