/*
Theme Name: Ying Liu Portfolio
Theme URI: https://example.com/
Author: Ying Liu
Description: A single-page developer portfolio theme for Ying Liu — full-stack developer building AI-powered web platforms. Content lives in front-page.php; contact email comes from Settings → General.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ying-portfolio
*/

:root {
  --bg: #f3efe6;
  --bg-2: #ebe6d9;
  --ink: #15130f;
  --ink-2: #4a463c;
  --line: #d6cfbe;
  --accent: #e2461a;
  --accent-ink: #ffffff;
  --card: #faf8f2;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110e;
    --bg-2: #1a1814;
    --ink: #f1ede2;
    --ink-2: #aaa393;
    --line: #2f2c25;
    --accent: #ff6a3d;
    --accent-ink: #12110e;
    --card: #19170f;
  }
}
:root[data-theme="dark"] {
  --bg: #12110e;
  --bg-2: #1a1814;
  --ink: #f1ede2;
  --ink-2: #aaa393;
  --line: #2f2c25;
  --accent: #ff6a3d;
  --accent-ink: #12110e;
  --card: #19170f;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 24px; }
.brand { font-family: var(--serif); font-size: 24px; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--accent); }
.nav .cta { color: var(--accent-ink); background: var(--accent); padding: 8px 14px; border-radius: 999px; }
.nav .cta:hover { color: var(--accent-ink); opacity: .88; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 6px 12px; font-family: var(--mono); font-size: 12px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 18px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; width: 100%; }
  .nav .cta { width: auto; margin-top: 8px; }
}

/* Hero */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 7vw, 88px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #2fb36a; box-shadow: 0 0 0 4px color-mix(in srgb, #2fb36a 25%, transparent); }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 9vw, 120px); line-height: .98; letter-spacing: -.025em;
  margin: 22px 0 0; max-width: 14ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: clamp(18px, 2vw, 22px); color: var(--ink-2); max-width: 58ch; margin: 28px 0 0; line-height: 1.5; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; padding: 14px 22px; border-radius: 999px; border: 1px solid var(--ink); transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-2px); color: inherit; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: clamp(48px, 7vw, 88px); }
.stat { padding: 26px 22px 26px 0; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5vw, 60px); line-height: 1; letter-spacing: -.02em; }
.stat span { display: block; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Sections */
section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { display: grid; grid-template-columns: 200px 1fr; gap: 24px; margin-bottom: 44px; align-items: baseline; }
.section-head .mono { color: var(--accent); }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -.02em; margin: 0; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; gap: 8px; } }

/* About */
.about-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.about-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.about-grid li { padding: 18px 0; border-top: 1px solid var(--line); font-size: 18px; max-width: 70ch; }
.about-grid li:last-child { border-bottom: 1px solid var(--line); }
.about-grid li strong { font-weight: 600; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* Projects */
.project { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 4vw, 44px); margin-bottom: 28px; }
.project-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: flex-start; }
.project .num { color: var(--accent); }
.project h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.015em; margin: 8px 0 0; max-width: 20ch; }
.project .live { white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.tags li { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--bg); }
.project .summary { font-size: 19px; color: var(--ink-2); max-width: 62ch; margin: 22px 0 0; }

.pipeline { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: 30px 0 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.pipeline .step { flex: 1 1 110px; padding: 14px 14px; border: 1px solid var(--line); background: var(--bg); margin-left: -1px; display: flex; flex-direction: column; gap: 4px; }
.pipeline .step:first-child { margin-left: 0; border-radius: 12px 0 0 12px; }
.pipeline .step:last-child { border-radius: 0 12px 12px 0; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pipeline .step small { color: var(--accent); font-size: 10.5px; }
.pipeline .step:last-child small { color: var(--accent); }
@media (max-width: 760px) {
  .pipeline { flex-direction: column; }
  .pipeline .step { margin-left: 0; margin-top: -1px; flex-basis: auto; }
  .pipeline .step:first-child { border-radius: 12px 12px 0 0; }
  .pipeline .step:last-child { border-radius: 0 0 12px 12px; }
}

.bullets { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.bullets li { position: relative; padding: 14px 0 14px 22px; border-top: 1px solid var(--line); font-size: 15.5px; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 0; top: 24px; width: 8px; height: 2px; background: var(--accent); }
@media (max-width: 860px) { .bullets { grid-template-columns: 1fr; } }

/* Experience */
.job { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 32px 0; border-top: 1px solid var(--line); }
.job:last-child { border-bottom: 1px solid var(--line); }
.job .when { color: var(--ink-2); }
.job h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.job .org { color: var(--accent); margin: 6px 0 0; }
.job ul { margin: 18px 0 0; padding-left: 18px; color: var(--ink-2); max-width: 74ch; font-size: 16px; }
.job li { margin-bottom: 8px; }
.job li::marker { color: var(--accent); }
@media (max-width: 760px) { .job { grid-template-columns: 1fr; gap: 8px; } }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.skill { padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skill h3 { margin: 0 0 14px; color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.skill p { margin: 0; font-size: 16px; line-height: 1.75; }
@media (max-width: 900px) { .skills { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }

/* Education */
.edu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.edu-item { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.edu-item .mono { color: var(--accent); }
.edu-item h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 10px 0 8px; }
.edu-item p { margin: 0; color: var(--ink-2); font-size: 15px; }
.fast { margin-top: 28px; padding: 22px 26px; border: 1px dashed var(--line); border-radius: 16px; color: var(--ink-2); max-width: 78ch; }
@media (max-width: 860px) { .edu { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--ink); color: var(--bg); }
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 8vw, 104px); line-height: 1; letter-spacing: -.025em; margin: 0; max-width: 14ch; }
.contact h2 em { color: var(--accent); }
.contact p { color: color-mix(in srgb, var(--bg) 65%, transparent); max-width: 50ch; font-size: 19px; margin: 24px 0 0; }
.contact .btn { margin-top: 32px; background: var(--accent); border-color: var(--accent); color: #fff; }
.contact .btn:hover { color: #fff; opacity: .9; }
.contact .mono { color: color-mix(in srgb, var(--bg) 55%, transparent); }

.site-footer { padding: 28px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.home .site-footer { border-top: 0; background: var(--ink); color: color-mix(in srgb, var(--bg) 55%, transparent); }

/* Generic pages / posts */
.entry { padding: 72px 0; max-width: 720px; }
.entry h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 6vw, 64px); line-height: 1.05; margin: 0 0 24px; }
.entry .content > * + * { margin-top: 1.1em; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
