/* ============================================================
   Jingyi Yang — personal site
   Design tokens + the utility set used across the pages.
   ============================================================ */

:root {
  --radius: .5rem;

  --background: oklch(98.1% .005 90);
  --foreground: oklch(28% .025 265);
  --card: oklch(99.5% .003 90);
  --card-foreground: oklch(28% .025 265);
  --primary: oklch(40% .09 255);
  --primary-foreground: oklch(98.5% .004 90);
  --secondary: oklch(94.5% .008 85);
  --secondary-foreground: oklch(35% .03 265);
  --muted: oklch(95.5% .007 88);
  --muted-foreground: oklch(52% .02 262);
  --accent: oklch(93% .02 80);
  --accent-foreground: oklch(32% .04 260);
  --border: oklch(90% .008 85);
  --ring: oklch(40% .09 255);

  --font-sans: "Karla", "Helvetica Neue", sans-serif;
  --font-display: "Newsreader", "Georgia", serif;
}

/* ---------- reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--border);
}

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

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
  text-align: left;
}

::selection { background: color-mix(in oklab, var(--primary) 18%, transparent); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- layout ---------- */

.mx-auto { margin-inline: auto; }
.max-w-4xl { max-width: 56rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-col-reverse { flex-direction: column-reverse; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.shrink-0 { flex-shrink: 0; }
.block { display: block; }
.text-center { text-align: center; }

.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-10 { gap: 2.5rem; }

.space-y-3 > * + * { margin-top: .75rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.px-3\.5 { padding-inline: .875rem; }
.px-5 { padding-inline: 1.25rem; }
.px-6 { padding-inline: 1.5rem; }
.py-1\.5 { padding-block: .375rem; }
.py-2\.5 { padding-block: .625rem; }
.py-4 { padding-block: 1rem; }
.py-10 { padding-block: 2.5rem; }
.py-14 { padding-block: 3.5rem; }
.py-16 { padding-block: 4rem; }
.pl-4 { padding-left: 1rem; }
.pt-5 { padding-top: 1.25rem; }
.pt-20 { padding-top: 5rem; }
.pb-10 { padding-bottom: 2.5rem; }
.pb-16 { padding-bottom: 4rem; }

.mt-1 { margin-top: .25rem; }
.mt-1\.5 { margin-top: .375rem; }
.mt-2 { margin-top: .5rem; }
.mt-2\.5 { margin-top: .625rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-7 { margin-top: 1.75rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-14 { margin-top: 3.5rem; }

.sticky { position: sticky; }
.top-0 { top: 0; }
.z-40 { z-index: 40; }

.h-px { height: 1px; }
.w-full { width: 100%; }
.h-40 { height: 10rem; }
.w-40 { width: 10rem; }
.scroll-mt-24 { scroll-margin-top: 6rem; }

.object-cover { object-fit: cover; }
.rounded-full { border-radius: 9999px; }

/* ---------- type ---------- */

.font-display { font-family: var(--font-display); }

.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-\[11px\] { font-size: 11px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }

.tracking-tight { letter-spacing: -.025em; }
.tracking-\[0\.14em\] { letter-spacing: .14em; }
.tracking-\[0\.18em\] { letter-spacing: .18em; }
.tracking-\[0\.22em\] { letter-spacing: .22em; }

/* ---------- color ---------- */

.text-foreground { color: var(--foreground); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-secondary-foreground { color: var(--secondary-foreground); }
.text-foreground\/70 { color: color-mix(in oklab, var(--foreground) 70%, transparent); }
.text-foreground\/80 { color: color-mix(in oklab, var(--foreground) 80%, transparent); }
.text-foreground\/85 { color: color-mix(in oklab, var(--foreground) 85%, transparent); }
.text-foreground\/90 { color: color-mix(in oklab, var(--foreground) 90%, transparent); }
.text-muted-foreground\/60 { color: color-mix(in oklab, var(--muted-foreground) 60%, transparent); }

.bg-card { background-color: var(--card); }
.bg-border { background-color: var(--border); }
.bg-primary { background-color: var(--primary); }
.bg-background\/85 { background-color: color-mix(in oklab, var(--background) 85%, transparent); }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-l-2 { border-left-width: 2px; }
.border-border { border-color: var(--border); }
.border-border\/70 { border-color: color-mix(in oklab, var(--border) 70%, transparent); }
.border-primary\/20 { border-color: color-mix(in oklab, var(--primary) 20%, transparent); }
.border-primary\/30 { border-color: color-mix(in oklab, var(--primary) 30%, transparent); }

.shadow-sm { box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); }
.backdrop-blur-md { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ---------- transitions & hover ---------- */

.transition-colors {
  transition-property: color, background-color, border-color;
  transition-duration: .15s;
  transition-timing-function: cubic-bezier(.4, 0, .2, 1);
}

.transition-opacity {
  transition-property: opacity;
  transition-duration: .15s;
  transition-timing-function: cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) {
  .hover\:text-primary:hover { color: var(--primary); }
  .hover\:text-primary\/80:hover { color: color-mix(in oklab, var(--primary) 80%, transparent); }
  .hover\:text-primary-foreground:hover { color: var(--primary-foreground); }
  .hover\:bg-primary:hover { background-color: var(--primary); }
  .hover\:bg-accent:hover { background-color: var(--accent); }
  .hover\:opacity-90:hover { opacity: .9; }
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s cubic-bezier(.22, 1, .36, 1),
              transform .7s cubic-bezier(.22, 1, .36, 1);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- sm: 40rem and up ---------- */

@media (min-width: 40rem) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:items-baseline { align-items: baseline; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:gap-6 { gap: 1.5rem; }
  .sm\:gap-7 { gap: 1.75rem; }
  .sm\:pt-28 { padding-top: 7rem; }
  .sm\:py-24 { padding-block: 6rem; }
  .sm\:h-48 { height: 12rem; }
  .sm\:w-48 { width: 12rem; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .sm\:text-5xl { font-size: 3rem; line-height: 1; }
  .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

/* ---------- line-height overrides ----------
   Last in the file so they win over the line-height that the font-size
   utilities set, at every breakpoint. */

.leading-\[1\.05\] { line-height: 1.05; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }

[hidden] { display: none !important; }
