/* Alice Tan · article pages. Same world as the homepage, set for reading. */
:root {
  --orange: #ff5b1f; --orange-deep: #e9490f; --orange-text: #a8360a;
  --ink: #1f1611; --ink-soft: #5c4b40;
  --board: #eeece8; --board-2: #e3dfd9; --paper: #fcfaf7;
  --esp: #1c1512; --esp-2: #2a201b; --on-esp: #f4eee7; --on-esp-soft: #bcab9c;
  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --text: "Hanken Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --header-h: 4.25rem;
  --hair: color-mix(in oklab, var(--ink) 14%, transparent);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1.5rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: radial-gradient(circle, color-mix(in oklab, var(--ink) 9%, transparent) 1px, transparent 1.5px) 0 0 / 26px 26px, var(--board); color: var(--ink); font-family: var(--text); font-size: clamp(1.02rem, .98rem + .22vw, 1.14rem); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; }
::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
:root { caret-color: var(--orange); accent-color: var(--orange); }
table, time { font-variant-numeric: tabular-nums; }
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 1rem; }
.mono { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--ink); color: var(--orange); font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1; padding-bottom: .12rem; }
.text-link { display: inline-flex; align-items: center; gap: .35em; font-weight: 650; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: .3em; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; gap: 2rem; padding-inline: var(--gutter); background: var(--board); box-shadow: 0 1px 0 var(--hair); }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--display); font-weight: 750; letter-spacing: .09em; font-size: .95rem; }
#main-navigation { display: flex; gap: clamp(1rem, 2vw, 2rem); margin-left: auto; }
#main-navigation a { position: relative; text-decoration: none; font-weight: 600; font-size: .94rem; padding-block: .4rem; }
#main-navigation a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease); }
#main-navigation a:hover::after, #main-navigation a[aria-current]::after { transform: scaleX(1); }
#main-navigation a[aria-current] { color: var(--orange-text); }
.header-connect { display: inline-flex; align-items: center; gap: .4rem; padding: .62rem 1.15rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 650; font-size: .92rem; text-decoration: none; }
.header-connect:hover { background: var(--esp-2); }
.read-progress { position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; }
.read-progress span { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.menu-toggle { display: none; margin-left: auto; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
.menu-toggle span { display: grid; gap: 5px; justify-items: center; }
.menu-toggle i { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 200ms var(--ease); }
.menu-toggle[aria-expanded="true"] i:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* article */
article { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7rem); }
.article-header { max-width: 50rem; margin: 0 auto clamp(2rem, 4vw, 3rem); display: grid; gap: 1rem; justify-items: start; }
.article-back { font-weight: 650; text-decoration: none; display: inline-flex; gap: .5rem; align-items: center; color: var(--ink-soft); }
.article-back::before { content: ""; width: 1.1em; height: 1.1em; background: var(--orange-text); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.article-back:hover { color: var(--ink); }
.article-category { font-size: .78rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-text); margin: 0; }
.article-title { font-family: var(--display); font-weight: 700; font-variation-settings: "wdth" 92, "opsz" 96; font-size: clamp(2.4rem, 1.4rem + 4vw, 4.6rem); line-height: .98; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.article-deck { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.45rem); line-height: 1.45; color: var(--ink-soft); margin: 0; max-width: 40ch; }
.article-meta { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.article-cover { max-width: 62rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); border-radius: 18px; overflow: hidden; box-shadow: 0 2px 4px rgb(60 30 10 / .1), 0 30px 60px -30px rgb(60 30 10 / .45); }
.article-cover img { width: 100%; }
.article-reading-layout { max-width: 72rem; margin: 0 auto; display: grid; grid-template-columns: 14rem minmax(0, 44rem); gap: clamp(2rem, 5vw, 5rem); justify-content: center; }
.article-toc { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
.article-toc summary { list-style: none; font-size: .78rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); cursor: pointer; margin-bottom: .9rem; }
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc nav { display: grid; gap: .1rem; border-left: 2px solid var(--hair); }
.article-toc a { display: block; padding: .45rem 0 .45rem 1rem; margin-left: -2px; border-left: 2px solid transparent; font-size: .9rem; line-height: 1.35; text-decoration: none; color: var(--ink-soft); transition: color 160ms, border-color 160ms; }
.article-toc a:hover { color: var(--ink); }
.article-toc a[aria-current] { color: var(--ink); font-weight: 650; border-left-color: var(--orange); }
.article-content > * { margin: 0 0 1.25rem; }
.article-content p, .article-content li { color: color-mix(in oklab, var(--ink) 88%, var(--board)); }
.article-content h2 { font-family: var(--display); font-weight: 650; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem); line-height: 1.08; letter-spacing: -0.02em; margin: 3.25rem 0 1rem; text-wrap: balance; }
.article-content h3 { font-family: var(--display); font-weight: 650; font-size: 1.2rem; letter-spacing: -0.01em; margin: 0 0 .3rem; }
.article-content strong { color: var(--ink); }
.article-content ul, .article-content ol { padding-left: 1.25rem; }
.article-content li { margin-bottom: .5rem; }
.article-content li::marker { color: var(--orange-text); font-weight: 700; }
.article-citation { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--orange) 70%, transparent); text-decoration-thickness: 2px; }
.article-citation:hover { color: var(--orange-text); }
.article-listicle { list-style: none; padding: 0 !important; counter-reset: li; display: grid; gap: .25rem; }
.article-listicle > li { counter-increment: li; position: relative; padding: 1rem 0 1rem 3.25rem; border-top: 1px solid var(--hair); margin: 0; }
.article-listicle > li::before { content: counter(li); position: absolute; left: 0; top: 1rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--orange); font-family: var(--display); font-weight: 750; font-size: .95rem; }
.article-listicle > li p { margin: 0; }
.article-callout { padding: 1.5rem 1.75rem; border-radius: 18px; background: var(--orange); color: var(--ink); }
.article-callout p { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 1.1rem + .5vw, 1.5rem); line-height: 1.3; }
.article-faq { padding: 1.25rem 0; border-top: 1px solid var(--hair); }
.article-faq p { margin: 0; }
.article-mobile-example { max-width: 26rem; margin-inline: auto !important; }
.article-mobile-example img { border-radius: 18px; box-shadow: 0 30px 60px -30px rgb(60 30 10 / .5); }
figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: .9rem; line-height: 1.5; }
.article-table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--paper); border-radius: 14px; overflow: hidden; }
.article-table th, .article-table td { text-align: left; padding: .9rem 1rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.article-table thead th { background: var(--ink); color: var(--paper); font-weight: 650; }
.article-source-note { font-size: .85rem; color: var(--ink-soft); caption-side: bottom; padding-top: .75rem; text-align: left; }
/* the table caption lines up with the cells' text instead of touching the card edge */
.article-table caption.article-source-note { padding: .75rem 1rem .9rem; }
.article-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 2rem; margin-top: 3rem !important; border-top: 2px solid var(--ink); }

/* directory */
.article-directory { max-width: 82rem; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(4rem, 8vw, 7rem); }
.crumb { font-size: .9rem; color: var(--ink-soft); margin: 0 0 1.25rem; }
.crumb a { text-decoration-color: var(--orange); }
.crumb span { font-weight: 650; color: var(--ink); }
.article-cat { font-weight: 700; color: var(--orange-text); }
.ico { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.article-directory > h1 { font-family: var(--display); font-weight: 700; font-variation-settings: "wdth" 92, "opsz" 96; font-size: clamp(2.6rem, 1.5rem + 4.4vw, 5.2rem); line-height: .96; letter-spacing: -0.03em; margin: 0 0 1.25rem; }
.article-directory > p { color: var(--ink-soft); font-size: 1.15rem; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.article-directory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 3vw, 3rem); }
.article-preview { position: relative; display: grid; gap: 1.25rem; align-content: start; }
.article-preview-image { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; }
.article-preview-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.article-preview-copy { display: grid; gap: .55rem; }
.article-preview-copy > * { margin: 0; }
.article-preview h2 { font-family: var(--display); font-weight: 650; font-size: clamp(1.45rem, 1.2rem + 1vw, 2.2rem); letter-spacing: -0.02em; line-height: 1.05; }
.article-preview h2 a { text-decoration: none; }
.article-excerpt { color: var(--ink-soft); }
.article-read-link { font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: .3em; justify-self: start; }
@media (hover: hover) and (pointer: fine) { .article-preview:hover .article-preview-image img { transform: scale(1.04); } .article-preview:hover h2 { color: var(--orange-text); } }

/* footer */
.site-footer { background: var(--esp); color: var(--on-esp); padding: 2.25rem var(--gutter); }
.foot-inner { max-width: 82rem; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer-name { text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.1rem; display: grid; }
.footer-name span { font-family: var(--text); font-weight: 500; font-size: .88rem; color: var(--on-esp-soft); }
.site-footer p { margin: 0; color: var(--on-esp-soft); font-size: .92rem; }
.site-footer :focus-visible { outline-color: var(--orange); }

@media (max-width: 1050px) {
  .article-reading-layout { grid-template-columns: minmax(0, 44rem); }
  .article-toc { position: static; padding: 1rem 1.25rem; border-radius: 14px; background: var(--paper); }
  .article-toc summary { margin: 0; }
  .article-toc[open] summary { margin-bottom: .75rem; }
  /* show that the box opens: a hint and a chevron that flips when open */
  .article-toc summary { display: flex; align-items: center; gap: .6rem; }
  .article-toc summary::before { content: "Tap to view"; order: 2; margin-left: auto; font-size: .78rem; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--orange-text); }
  .article-toc[open] summary::before { content: "Hide"; }
  .article-toc summary::after { content: ""; order: 3; flex: none; width: .5rem; height: .5rem; margin: -.2rem .15rem 0 0; border-right: 2px solid var(--orange-text); border-bottom: 2px solid var(--orange-text); transform: rotate(45deg); transition: transform 200ms; }
  .article-toc[open] summary::after { margin-top: .25rem; transform: rotate(-135deg); }
}
@media (max-width: 860px) {
  :root { --header-h: 3.75rem; }
  .site-header { padding-inline: 1rem; gap: .75rem; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .header-connect { display: none; }
  #main-navigation { position: fixed; top: var(--header-h); left: .75rem; right: .75rem; margin: 0; flex-direction: column; gap: 0; padding: .5rem; border-radius: 18px; background: var(--esp); color: var(--on-esp); }
  #main-navigation a { padding: .9rem 1rem; }
  #main-navigation a::after { display: none; }
  #main-navigation a[aria-current] { color: var(--orange); }
  #main-navigation[data-collapsed="true"] { display: none; }
  .article-directory-grid { grid-template-columns: 1fr; }
  .article-table { display: block; overflow-x: auto; }
}
@media print { .site-header, .article-toc { display: none; } }
