/* asalem.me: restrained executive style, mobile-first, no external dependencies */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5a5f6b;
  --faint: #686d77;          /* 4.77:1 on bg (AA) */
  --line: rgba(22, 24, 29, 0.1);
  --line-strong: rgba(22, 24, 29, 0.2);
  --accent: #a84f26;          /* terracotta, 5.06:1 on bg (AA) */
  --accent-2: #2f4f8f;        /* ink blue */
  --accent-soft: rgba(168, 79, 38, 0.07);
  --on-accent-2: #ffffff;     /* text on --accent-2 (primary button hover) */
  --ring: conic-gradient(from 210deg, #e9a86b, #a84f26, #2f4f8f, #7aa2e3, #e9a86b);
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 18px 40px -24px rgba(20, 20, 30, .24);
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC";
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", var(--cjk), serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", var(--cjk), sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #161920; --text: #eceae4; --muted: #a2a6b0; --faint: #7a808b;
    --line: rgba(236, 234, 228, 0.09); --line-strong: rgba(236, 234, 228, 0.2);
    --accent: #f0a46c; --accent-2: #8fb0ef; --accent-soft: rgba(240, 164, 108, 0.08); --on-accent-2: #0e1013;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 24px 50px -28px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #161920; --text: #eceae4; --muted: #a2a6b0; --faint: #7a808b;
  --line: rgba(236, 234, 228, 0.09); --line-strong: rgba(236, 234, 228, 0.2);
  --accent: #f0a46c; --accent-2: #8fb0ef; --accent-soft: rgba(240, 164, 108, 0.08); --on-accent-2: #0e1013;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 24px 50px -28px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  color: var(--text); background: var(--bg);
  background-image: radial-gradient(48rem 26rem at 88% -6%, var(--accent-soft), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 6px; }
.skip-link:focus { top: 1rem; }
.container { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
.muted { color: var(--faint); font-weight: 400; margin-left: .35rem; font-size: .9em; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 600; letter-spacing: .01em; font-size: .95rem; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--line-strong); font-family: var(--serif); font-size: .82rem; letter-spacing: .06em;
}
.brand-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
nav { margin-left: auto; }
.nav-list { display: flex; gap: .1rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: flex; align-items: center; min-height: 44px; padding: .4rem .55rem; color: var(--muted); font-size: .88rem; letter-spacing: .02em; border-radius: 4px; }
.nav-list a:hover { color: var(--text); }
.nav-optional { display: none; }
.theme-toggle {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw + .6rem, 5rem); line-height: 1.02; }
h2 { font-size: clamp(1.75rem, 2.2vw + 1rem, 2.4rem); line-height: 1.1; }
h3 { font-size: 1.3rem; line-height: 1.25; }
.eyebrow, .kicker {
  margin: 0 0 1.25rem; font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.kicker { color: var(--accent); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .75rem; }
#main { counter-reset: sec; }
.section { counter-increment: sec; }
.kicker::before { content: counter(sec, decimal-leading-zero); }
.kicker::after { content: ""; width: 2rem; height: 1px; background: var(--line-strong); }
.eyebrow { color: var(--accent); }
.lede { font-size: clamp(1.1rem, .6vw + 1rem, 1.28rem); line-height: 1.6; color: var(--muted); max-width: 38ch; margin: 1.5rem 0 0; }
.lede-tight { margin-top: 0; }

/* Hero */
.hero { position: relative; display: grid; gap: 2.5rem; padding-block: 3.5rem 4.5rem; align-items: center; }
.hero-visual { order: -1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .78rem 1.35rem; border-radius: 6px;
  font-weight: 550; font-size: .93rem; letter-spacing: .01em; border: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent-2); color: var(--on-accent-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }

/* Portrait: round crop, gradient ring + mat so the white backdrop never reads as a hard box */
.portrait {
  position: relative; margin: 0; width: clamp(160px, 46vw, 210px); aspect-ratio: 1; border-radius: 50%;
  padding: 4px; background: var(--ring); box-shadow: var(--shadow);
}
.portrait picture { display: block; width: 100%; height: 100%; border-radius: 50%; padding: 5px; background: var(--bg); overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transform: scale(1.22); transform-origin: 50% 30%; }
:root[data-theme="dark"] .portrait img { filter: brightness(.92) contrast(1.03); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .portrait img { filter: brightness(.92) contrast(1.03); } }

/* Sections */
.section { padding-block: 4.5rem; border-top: 1px solid var(--line); }
.section-grid { display: grid; gap: 1.5rem; }
.section-head .kicker { margin-bottom: .5rem; }
.section-body { display: grid; gap: 2.5rem; }
.prose { max-width: 62ch; font-size: 1.1rem; }
.prose p { margin: 0 0 1.1rem; }

.credentials { margin: 0; border-top: 1px solid var(--line-strong); }
.credentials > div { display: grid; gap: .2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.credentials dt { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.credentials dd { margin: 0; font-weight: 500; line-height: 1.6; }

.focus-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-strong); counter-reset: f; }
.focus-list li { padding: 1.5rem 0 1.75rem; border-bottom: 1px solid var(--line); counter-increment: f; }
.focus-list li::before { content: counter(f, decimal-leading-zero); display: block; font-size: .75rem; letter-spacing: .14em; color: var(--accent); margin-bottom: .6rem; font-variant-numeric: tabular-nums; }
.focus-list p { margin: .6rem 0 0; color: var(--muted); }
.focus-list li:last-child { border-bottom: 0; }
.focus-list h3 { font-size: 1.35rem; }

/* Links that point at #work hide themselves if the Chinese Fun card section is removed */
body:not(:has(#work)) .needs-work { display: none; }

/* Contact */
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.contact-list a, .cl-row { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; align-items: baseline; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.contact-list .cl-label { grid-column: 1 / -1; }
.contact-list .arrow { grid-column: 2; grid-row: 2; }
.cl-label { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.cl-value { font-weight: 500; overflow-wrap: break-word; min-width: 0; }
.contact-list a:hover .cl-value { color: var(--accent); }
.contact-list a:hover .arrow { transform: translateX(3px); }
.arrow { display: inline-block; transition: transform .25s ease; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; color: var(--faint); font-size: .85rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.footer-inner p { margin: 0; }
.footer-inner a:hover { color: var(--text); }

/* Reveal motion (only with JS; content visible without JS) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Wider screens */
@media (min-width: 560px) {
  .brand-name { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  .nav-optional { display: block; }
}
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.5fr 1fr; padding-block: 7rem 7.5rem; gap: 4rem; }
  .hero-visual { order: 0; justify-self: end; }
  .portrait { width: 340px; padding: 5px; }
  .portrait picture { padding: 7px; }
  .section { padding-block: 6.5rem; }
  .section-grid { grid-template-columns: 15rem 1fr; gap: 4rem; }
  .section-head .kicker { margin-bottom: 1rem; }
  .section-body { grid-template-columns: 1.25fr 1fr; gap: 3.5rem; align-items: start; }
  #contact .section-body { grid-template-columns: 1fr; gap: 2rem; }
  .contact-list a, .cl-row { grid-template-columns: 9rem 1fr auto; }
  .contact-list .cl-label { grid-column: auto; }
  .contact-list .arrow { grid-column: auto; grid-row: auto; }
  .focus-list { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; border-top: 0; }
  .focus-list li { border-top: 1px solid var(--line-strong); border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover { transform: none !important; }
  .contact-list a:hover .arrow { transform: none !important; }
}

/* BEGIN chinese-fun card styles: only used by the "chinese-fun card" block in index.html; safe to delete with it */
.feature {
  position: relative; display: grid; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.feature-body { padding: 1.75rem; display: flex; flex-direction: column; gap: .8rem; }
.feature-label { margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.feature h3 { font-size: clamp(1.5rem, 1.4vw + 1.1rem, 2rem); }
.feature-desc { margin: 0; color: var(--muted); max-width: 52ch; }
.feature-link::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.feature-link:focus-visible { outline: none; }
.feature:has(.feature-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
.feature-url { margin-top: .6rem; font-size: .9rem; font-weight: 550; color: var(--text); display: inline-flex; gap: .5rem; align-items: center; }
.feature-art {
  order: -1; display: grid; place-items: center; min-height: 150px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg)), color-mix(in srgb, var(--accent-2) 10%, var(--bg)));
}
.cjk { font-family: var(--cjk), sans-serif; letter-spacing: .02em; }
.feature h3 .cjk { margin-right: .35rem; }
.feature-art span { font-family: var(--cjk), sans-serif; font-weight: 600; font-size: 3.5rem; letter-spacing: .15em; color: var(--accent); opacity: .9; }
.feature:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.feature:hover .arrow { transform: translateX(4px); }

@media (min-width: 860px) {
  .feature { grid-template-columns: 1.4fr 1fr; }
  .feature-body { padding: 2.75rem; }
  .feature-art { order: 0; border-bottom: 0; border-left: 1px solid var(--line); min-height: 260px; }
  .feature-art span { font-size: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .feature:hover { transform: none !important; }
  .feature:hover .arrow { transform: none !important; }
}
/* END chinese-fun card styles */
