/* minseo.ng — red #DF301C · cream #FFF1D1 */

:root {
  --red: #DF301C;
  --cream: #FFF1D1;
  --ink: #2B0D07;
  --muted: #FFF1D1;
  --line: #FFF1D1;

  --font: "Wanted Sans Variable", "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --max: 680px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--red);
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--cream); color: var(--red); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}
.wrap--wide { max-width: 1200px; }

/* ── Home: soft tiles on red ── */

.tile {
  --muted: #6E655C;
  --line: rgba(26, 26, 26, .18);
  background: var(--cream);
  color: #1A1A1A;
  border-radius: 18px;
  padding: 22px 24px;
}
.tile .fact-label, .tile .year { color: var(--red); opacity: 1; }
.tile .links a:hover, .tile .fact-list a:hover { color: var(--red); border-color: var(--red); }

/* the card stack sits in the middle of the screen */
body.home {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}

.home-grid {
  max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.home-grid .notes { margin-top: 0; }

/* two columns: the notes card takes the left column's height
   (absolute, so it never makes the row taller) and shows as many titles as fit */
.home-grid { align-items: stretch; }
.home-right { position: relative; }
.home-grid .notes { position: absolute; inset: 0; display: flex; flex-direction: column; }
.home-grid .home-posts { flex: 1; min-height: 0; overflow: hidden; }
.home-foot { max-width: 1040px; }

@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; max-width: 680px; }
  .home-grid .notes { position: static; }
  .home-foot { max-width: 680px; }
}
.hero { padding: 28px 24px 26px; }
.hero-logo { width: 88px; height: auto; }
.hero-name { margin: 28px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hero-line { margin: 4px 0 0; opacity: .85; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.fact--wide { grid-column: 1 / -1; }
.fact-label { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .02em; opacity: .7; }
.fact-main { margin: 0; font-weight: 600; }
.fact-sub { margin: 2px 0 0; font-size: 14px; opacity: .85; }
.fact-list { margin: 0; padding: 0; list-style: none; }
.fact-list li + li { margin-top: 4px; }
.fact-list a { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.fact-list a:hover span:first-child { text-decoration: underline; text-underline-offset: 4px; }
.fact-year { font-weight: 400; font-size: 14px; opacity: .8; font-variant-numeric: tabular-nums; }
.facts .links { gap: 4px 16px; }

.more-link { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.more-link:hover { border-color: var(--cream); }

/* ── Notes tile: grouped by year ── */

.notes { margin-top: 12px; padding-bottom: 12px; }
.notes-head { display: flex; justify-content: space-between; align-items: baseline; }
.notes-head .fact-label { margin: 0; }
.notes-count { font-size: 13px; opacity: .7; }
.home-posts { margin-top: 10px; }
.home-posts .post { margin: 0 -12px; padding: 10px 12px; border: 0; border-radius: 10px; transition: background .2s, color .2s; }
.home-posts.list li .post,
.home-posts.list li:last-child .post { border: 0; }
.home-posts .post-title { font-size: 16px; font-weight: 600; text-decoration: none; }
.tile .home-posts .post:hover { background: rgba(223, 48, 28, .08); color: var(--red); }
.tile .more { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--muted); }
.tile .more:hover { color: var(--red); }

.year-group { padding-top: 18px; }
.year { margin: 0 0 2px; font-size: 13px; font-weight: 600; opacity: .7; font-variant-numeric: tabular-nums; }
.archive .post {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin: 0 -12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  transition: background .2s;
}
.archive .post:hover { background: rgba(255, 241, 209, .1); }
.tile .archive .post:hover { background: rgba(223, 48, 28, .08); color: var(--red); }
.archive .list li:last-child .post { border: 0; }
.archive .post-title { font-size: 16px; font-weight: 600; text-decoration: none; }
.post-date { flex: none; font-size: 14px; opacity: .7; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; }
  .tile { padding: 20px; }
}

/* ── Header ── */

.header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 32px;
}
.header-logo img { height: 36px; width: auto; }


/* ── Intro ── */

.intro { padding: 56px 0 24px; }
.intro h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.35;
}
.intro p { margin: 16px 0 0; color: var(--muted); }
.intro-logo { width: 160px; height: auto; margin-bottom: 32px; }

/* ── Section ── */

.section { padding: 88px 0 0; }
.label {
  margin: 0 0 20px;
  font-size: clamp(44px, 11vw, 80px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.055em;
  color: var(--cream);
}


.label--sm {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── List rows (works, posts, awards) ── */

.list { margin: 0; padding: 0; list-style: none; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.list li:last-child .row { border-bottom: 1px solid var(--line); }
.row-title { font-weight: 600; }
.row-sub { display: block; color: var(--muted); font-size: 15px; font-weight: 400; }
.row-meta { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
a.row .row-title { text-decoration: underline 1px transparent; text-underline-offset: 4px; transition: text-decoration-color .2s; }
a.row:hover .row-title { text-decoration-color: currentColor; }

/* ── Post list ── */

.post {
  display: block;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.list li:last-child .post { border-bottom: 1px solid var(--line); }
.post-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.02em;
  text-decoration: underline 1.5px transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color .2s;
}
.post:hover .post-title { text-decoration-color: currentColor; }

.more { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--muted); }
.more:hover { color: var(--cream); }

.empty { padding: 14px 0; color: var(--muted); border-top: 1px solid var(--line); }

/* ── Apps (App Store style) ── */

.apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.app {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}
/* separator starts after the icon, like the App Store */
.app::after {
  content: "";
  position: absolute;
  left: 74px;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid var(--line);
}
.app-icon {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--red);
  font-size: 28px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, .08);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon img[src$=".svg"] { width: 60%; height: 60%; object-fit: contain; }
.app-info {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.app-name { font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-desc {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-get {
  flex: none;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  transition: transform .2s;
}
.app:hover .app-get { transform: scale(1.06); }
.app:active .app-get { transform: scale(.96); }

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

/* ── Links ── */

.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.links a { border-bottom: 1px solid var(--line); transition: color .2s, border-color .2s; }
.links a:hover { border-color: var(--cream); }

/* ── Footer ── */

.footer { padding: 96px 0 48px; color: var(--muted); font-size: 14px; }

/* ── Blog index ── */

.page-title { margin: 56px 0 16px; font-size: clamp(44px, 11vw, 80px); font-weight: 900; line-height: .95; letter-spacing: -.055em; }
.page-lead { margin: 0 0 32px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.tag {
  font: inherit;
  font-size: 14px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--cream);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.tag:hover { border-color: var(--cream); }
.tag[aria-pressed="true"] { background: var(--cream); color: var(--red); border-color: var(--cream); }

/* ── Article ── */

.article-meta { margin: 56px 0 8px; color: var(--muted); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.article-title { margin: 0 0 40px; font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: -.025em; }

.prose { font-size: 17px; line-height: 1.85; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2, .prose h3 { margin: 2em 0 0; line-height: 1.4; letter-spacing: -.02em; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose a { border-bottom: 1px solid currentColor; }
.prose img { border-radius: 4px; margin: 1.8em 0; }
.prose blockquote { margin: 1.4em 0 0; padding-left: 16px; border-left: 2px solid var(--cream); color: var(--muted); }
.prose code { font-size: .88em; background: rgba(255, 241, 209, .15); padding: 2px 5px; border-radius: 3px; }
.prose pre { background: var(--ink); color: var(--cream); padding: 16px 18px; border-radius: 4px; overflow-x: auto; font-size: 14px; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 700; border-bottom-width: 2px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.article-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.article-foot a:hover { color: var(--cream); }

@media (max-width: 480px) {
  .intro { padding-top: 32px; }
  .intro h1 { font-size: 24px; }
  .article-title { font-size: 25px; }
  .post-title { font-size: 19px; }
}

/* ── Page transitions (cross-document View Transitions) ── */

@view-transition { navigation: auto; }

.header { view-transition-name: header; }

::view-transition-old(root) { animation: page-out .22s ease-in both; }
::view-transition-new(root) { animation: page-in .45s cubic-bezier(.2, .7, .1, 1) both; }

@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ── Light theme: reading a post (cream bg, black text) ── */

body.light {
  --muted: #6E655C;
  --line: rgba(26, 26, 26, .15);
  background: var(--cream);
  color: #1A1A1A;
}
.light ::selection { background: var(--red); color: var(--cream); }
.light .article-foot a:hover { color: var(--red); }

/* top band: header + title stay red / cream */
.post-hero {
  --muted: var(--cream);
  --line: var(--cream);
  background: var(--red);
  color: var(--cream);
  padding-bottom: 56px;
}
.post-hero .article-title { margin-bottom: 0; }
.light .prose { margin-top: 56px; }
.light .prose a { color: var(--red); }
.light .prose blockquote { border-color: var(--red); }
.light .prose code { background: rgba(26, 26, 26, .07); }
.light .prose pre { background: #1A1A1A; color: var(--cream); }
[hidden] { display: none !important; }


/* ── Infinite scroll trigger (Work list) ── */

.list-sentinel { height: 1px; }


/* bottom breathing room now that there is no footer */
body:not(.home) main { padding-bottom: 96px; }

/* ── Loading bar shown the moment a link is clicked ── */
html.is-leaving::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  width: 100%;
  background: var(--cream);
  transform-origin: left;
  animation: leaving 1.2s cubic-bezier(.2, .7, .1, 1) forwards;
}
@keyframes leaving { from { transform: scaleX(0); } to { transform: scaleX(.85); } }
@media (prefers-reduced-motion: reduce) { html.is-leaving::before { animation: none; transform: scaleX(.85); } }

/* ── Home: latest notes as square cards (2 × 2) ── */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.home-right { display: flex; flex-direction: column; }
.note-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.note-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 22px;
  border-radius: 18px;
  background: var(--cream);
  color: #1A1A1A;
  transition: transform .25s cubic-bezier(.2, .7, .1, 1);
}
.note-card:hover { transform: translateY(-3px); }
.note-card-meta { font-size: 13px; font-weight: 600; color: var(--red); }
.note-card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.note-card:hover .note-card-title { color: var(--red); }

.notes-more { align-self: flex-end; margin-top: 14px; font-size: 14px; font-weight: 600; opacity: .85; }
.notes-more:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 560px) {
  .note-card { padding: 16px; }
  .note-card-title { font-size: 16px; }
}

/* ── Home: widget grid ──
   One square cell is the unit. Widgets are 1×1 or 2×1 cells, so every edge lines up.
   desktop (4 cols)                       mobile (2 cols)
   [ intro  2×1 ][ note1 ][ note2 ]       [ intro 2×1 ]
   [ edu ][award][ note3 ][ note4 ]       [ n1 ][ n2 ]
   [ contact 2×1][ notes → 2×1   ]        [ n3 ][ n4 ]  then edu, award, contact, notes → as 2×1 */

body.home { container-type: inline-size; }

.bento {
  --gap: 12px;
  --cols: 4;
  --cell: calc((min(100cqw, 1040px) - 40px - (var(--cols) - 1) * var(--gap)) / var(--cols));
  max-width: 1040px;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
}

.bento .tile,
.bento .note-card {
  height: 100%;
  margin: 0;
  padding: 22px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bento .note-cards { display: contents; }
.bento .note-cards li { min-width: 0; }
.bento .note-card { aspect-ratio: auto; justify-content: space-between; }

.w-intro   { grid-area: 1 / 1 / 2 / 3; justify-content: space-between; }
.bento .note-cards li:nth-child(1) { grid-area: 1 / 3; }
.bento .note-cards li:nth-child(2) { grid-area: 1 / 4; }
.w-edu     { grid-area: 2 / 1; }
.w-award   { grid-area: 2 / 2; }
.bento .note-cards li:nth-child(3) { grid-area: 2 / 3; }
.bento .note-cards li:nth-child(4) { grid-area: 2 / 4; }
.w-contact { grid-area: 3 / 1 / 4 / 3; }
.w-more    { grid-area: 3 / 3 / 4 / 5; }

.w-intro .hero-logo { width: 96px; }
.w-intro .hero-name { margin: 0; }

.w-edu .fact-main, .w-award .fact-list { margin-top: auto; }
.w-contact .links { margin-top: auto; }

.w-more { justify-content: space-between; transition: transform .25s cubic-bezier(.2, .7, .1, 1); }
.w-more:hover { transform: translateY(-3px); }
.more-count { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: auto; }
.more-go { margin-top: 10px; font-size: 14px; font-weight: 700; }
.w-more:hover .more-go { color: var(--red); }

@media (max-width: 960px) {
  /* two columns, capped so the squares never get huge on tablets */
  .bento { --cols: 2; --cell: calc((min(100cqw, 560px) - 40px - var(--gap)) / 2); max-width: 560px; }
  .w-intro   { grid-area: 1 / 1 / 2 / 3; }
  .bento .note-cards li:nth-child(1) { grid-area: 2 / 1; }
  .bento .note-cards li:nth-child(2) { grid-area: 2 / 2; }
  .bento .note-cards li:nth-child(3) { grid-area: 3 / 1; }
  .bento .note-cards li:nth-child(4) { grid-area: 3 / 2; }
  .w-edu     { grid-area: 4 / 1 / 5 / 3; }
  .w-award   { grid-area: 5 / 1 / 6 / 3; }
  .w-contact { grid-area: 6 / 1 / 7 / 3; }
  .w-more    { grid-area: 7 / 1 / 8 / 3; }
  .bento .tile, .bento .note-card { padding: 18px; }
  .w-intro .hero-logo { width: 56px; }
  .w-intro .hero-name { font-size: 19px; }
  .w-intro .hero-line { font-size: 14px; }
  .more-count { font-size: 36px; }
}

/* ── Home widgets: outline only (no fill) ── */
.bento .tile,
.bento .note-card {
  --muted: rgba(255, 241, 209, .75);
  --line: rgba(255, 241, 209, .35);
  background: transparent;
  color: var(--cream);
  border: 1.5px solid var(--cream);
}
.bento .fact-label,
.bento .note-card-meta { color: var(--cream); opacity: .75; }
.bento .fact-sub, .bento .fact-year { opacity: .8; }
.bento .links a { border-color: rgba(255, 241, 209, .4); }
.bento .links a:hover, .bento .fact-list a:hover { color: var(--cream); border-color: var(--cream); }

.bento .note-card, .bento .w-more { transition: background .2s, transform .25s cubic-bezier(.2, .7, .1, 1); }
.bento .note-card:hover, .bento .w-more:hover { background: rgba(255, 241, 209, .1); }
.bento .note-card:hover .note-card-title, .bento .w-more:hover .more-go { color: var(--cream); }

/* one random widget is filled on each visit (picked in site.js) */
.bento .is-filled {
  --muted: #6E655C;
  --line: rgba(26, 26, 26, .18);
  background: var(--cream);
  color: #1A1A1A;
}
.bento .is-filled .fact-label,
.bento .is-filled .note-card-meta { color: var(--red); opacity: 1; }
.bento .is-filled .links a { border-color: var(--line); }
.bento .is-filled .links a:hover,
.bento .is-filled .fact-list a:hover { color: var(--red); border-color: var(--red); }
.bento .is-filled.note-card:hover,
.bento .is-filled.w-more:hover { background: var(--cream); }
.bento .is-filled.note-card:hover .note-card-title,
.bento .is-filled.w-more:hover .more-go { color: var(--red); }
