/* Soil Intelligence Lab — main stylesheet */
:root {
  --paper: #fbfaf7;
  --paper-2: #f3efe7;
  --ink: #1d1a16;
  --muted: #6b645b;
  --rule: #e2dcd1;
  --loam: #7a4626;        /* primary accent, like Stanford's cardinal in the reference */
  --loam-deep: #5c331b;
  --moss: #4f6b3a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17.5px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--loam); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--loam-deep); }
:focus-visible { outline: 2px solid var(--loam); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 16px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 48px; height: 48px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-size: 31px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.1; }
.brand-inst {
  margin-top: 6px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--loam);
}
.inst-logos { display: flex; align-items: center; gap: 22px; flex: none; }
.inst-logos a { display: block; line-height: 0; }
.inst-logos a + a { padding-left: 22px; border-left: 1px solid var(--rule); }
.inst-logos img { width: auto; }
.logo-ntu { height: 48px; }
.logo-ase { height: 38px; }
.nav-row { border-top: 1px solid var(--rule); }
.site-nav {
  display: flex; flex-wrap: wrap; gap: 4px 30px; padding-top: 11px; padding-bottom: 11px;
  font-size: 17px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase;
}
.site-nav a { color: var(--ink); text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--loam); }
.site-nav a.active { border-bottom-color: var(--ink); }

/* ---------- home ---------- */
.hero { height: clamp(260px, 44vw, 540px); overflow: hidden; background: #e9e4d8; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

.intro {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px;
  padding-top: 44px; padding-bottom: 24px;
}
.statement {
  margin: 0; font-family: var(--serif); font-size: clamp(25px, 2.8vw, 33px);
  line-height: 1.28; font-weight: 400; letter-spacing: -0.005em;
}
.statement em { font-style: italic; color: var(--loam); }
.intro-side p { margin: 0 0 10px; color: #3a352e; }
.more { margin-top: 10px; font-weight: 500; }
.more a { text-decoration: none; }

.recruit {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px; margin: 4px 0;
  background: var(--paper-2); border-left: 3px solid var(--loam);
  color: var(--ink); text-decoration: none;
}
.recruit:hover { color: var(--ink); background: #eee8dc; }
.recruit-tag {
  flex: none; font-size: 11.5px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--loam);
}
.recruit-arrow { margin-left: auto; color: var(--loam); font-size: 20px; }

.section { padding-top: 40px; }
.section-title {
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}

.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.theme {
  position: relative; display: block; padding: 18px 18px 16px;
  background: #fff; border: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.theme:hover { border-color: var(--loam); color: var(--ink); transform: translateY(-2px); }
.theme h3 { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.15; margin: 10px 0 4px; }
.theme p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.theme-num { position: absolute; top: 18px; right: 18px; font-size: 13px; color: var(--muted); letter-spacing: 0.1em; }
.icon { width: 40px; height: 40px; fill: none; stroke: var(--loam); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon .fill { fill: var(--moss); stroke: none; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; padding-bottom: 12px; }

/* ---------- news ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.news li:last-child { border-bottom: 0; }
.news-date { font-size: 14px; font-weight: 500; color: var(--loam); padding-top: 2px; }
.news-text { font-size: 17px; line-height: 1.45; }

/* ---------- publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 1px; }
.pub:last-child { border-bottom: 0; }
.pub-title { font-weight: 500; font-size: 17.5px; line-height: 1.35; }
.pub-title a { color: var(--ink); text-decoration-color: var(--rule); }
.pub-title a:hover { color: var(--loam); text-decoration-color: var(--loam); }
.pub-authors { font-size: 15.5px; line-height: 1.4; color: #4a443c; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: 15.5px; line-height: 1.4; color: var(--muted); }
.pub-note { font-size: 14px; }
.pubs.compact .pub-authors { font-size: 14.5px; }
.pub-year { display: grid; grid-template-columns: 100px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--rule); }
.pub-year h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; color: var(--loam); margin: 6px 0 0; }

/* ---------- generic pages ---------- */
.page { padding-top: 36px; padding-bottom: 48px; }
.page-title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.2vw, 46px);
  letter-spacing: -0.01em; margin: 0 0 12px;
}
.lede { font-size: 19.5px; line-height: 1.45; color: #3a352e; margin: 0 0 26px; }
.prose h3 { font-family: var(--serif); font-size: 25px; font-weight: 600; margin: 26px 0 6px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose p { margin: 0 0 10px; }
.aside { margin-top: 32px; color: var(--muted); }

/* research */
.approach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--ink); margin-bottom: 16px; }
.approach > div { padding: 12px 18px 4px 0; }
.approach > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.approach-k { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.approach p { margin: 2px 0 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.theme-detail {
  display: grid; grid-template-columns: 100px 1fr; gap: 20px;
  padding: 24px 0; border-top: 1px solid var(--rule); scroll-margin-top: 24px;
}
.theme-head { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.theme-head .theme-num { position: static; }
.theme-detail h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; margin: 0; }
.theme-short { margin: 0 0 8px; color: var(--loam); font-weight: 500; }
.mini { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.theme-detail ul { padding-left: 20px; margin: 0; }
.theme-detail li { margin-bottom: 2px; }
.theme-detail p { margin: 0 0 8px; }
.reading { list-style: none; padding-left: 0 !important; }
.reading a::before { content: "↗"; text-decoration: none; display: inline-block; margin-right: 6px; }
.reading .no-link::before { content: "↗"; visibility: hidden; display: inline-block; margin-right: 6px; } /* a paper with no DOI yet, aligned with the links */

/* people */
.pi { display: grid; grid-template-columns: 240px 1fr; gap: 36px; margin: 8px 0 40px; }
.pi p { margin: 0 0 10px; }
.pi img { width: 240px; aspect-ratio: 4 / 5; object-fit: cover; }
.pi h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; margin: 0; }
.pi .native { color: var(--muted); font-size: 24px; margin-left: 6px; }
.pi-role { font-weight: 500; color: var(--loam); margin: 2px 0 12px !important; line-height: 1.4; }
.pi-role span { color: var(--muted); font-weight: 400; }
.pi-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 16px; font-weight: 500; }
.members { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 36px 28px; }
.member { display: flex; flex-direction: column; align-items: center; text-align: center; }
.member img, .initials { width: 100%; max-width: 200px; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 12px; }
.initials {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #4a3324, #7b4d2e 60%, #a8794f);
  color: #f3e7d2; font-family: var(--serif); font-size: 44px;
}
.member-name { font-weight: 600; }
.member-name a { color: var(--ink); }
.member-role { font-size: 15px; color: var(--loam); }
.member-note { font-size: 14.5px; color: var(--muted); }
.empty-team { background: var(--paper-2); padding: 18px 22px; margin-bottom: 36px; }
.empty-team p { margin: 0 0 12px; }
.empty-team p:last-child { margin: 0; }
.button { display: inline-block; background: var(--loam); color: #fff; padding: 9px 18px; text-decoration: none; font-weight: 500; font-size: 16px; }
.button:hover { background: var(--loam-deep); color: #fff; }
.alumni { width: 100%; border-collapse: collapse; font-size: 16px; }
.alumni th { text-align: left; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.alumni th, .alumni td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; background: #2a1f17; color: #d9cbb6; font-size: 16px; }
.site-footer a { color: #f1e3cc; }
.site-footer a:hover { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; padding-top: 32px; padding-bottom: 18px; }
.footer-inner p { margin: 0 0 6px; }
.footer-name { font-family: var(--serif); font-size: 23px; color: #fbf3e6; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-inner > div:last-child { text-align: right; }
.footer-inner > div:last-child .footer-links { justify-content: flex-end; }
.footer-base { padding-top: 12px; padding-bottom: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; color: #a8998a; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .site-nav { gap: 4px 24px; font-size: 16px; letter-spacing: 0.08em; }
}
@media (max-width: 880px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 14px; padding-bottom: 12px; }
}
@media (max-width: 960px) {
  .site-nav { gap: 4px 20px; font-size: 15.5px; letter-spacing: 0.07em; }
  .themes { grid-template-columns: repeat(2, 1fr); }
  .intro, .two-col { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 900px) {
  .site-nav { gap: 4px 16px; font-size: 14.5px; letter-spacing: 0.06em; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 25px; }
  .inst-logos { gap: 16px; }
  .inst-logos a + a { padding-left: 16px; }
  .logo-ntu { height: 38px; }
  .logo-ase { height: 30px; }
  .brand-inst { font-size: 10px; letter-spacing: 0.16em; margin-top: 5px; }
  .site-nav { gap: 2px 14px; font-size: 13.5px; letter-spacing: 0.05em; padding-top: 8px; padding-bottom: 8px; }
  .intro { padding-top: 32px; }
  body { font-size: 17px; }
  .themes { grid-template-columns: 1fr; }
  .recruit { flex-wrap: wrap; gap: 4px 14px; }
  .recruit-arrow { display: none; }
  .approach { grid-template-columns: 1fr; }
  .approach > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .theme-detail, .pub-year { grid-template-columns: 1fr; gap: 10px; }
  .theme-head { flex-direction: row; align-items: center; }
  .pi { grid-template-columns: 1fr; gap: 20px; }
  .pi img { width: 200px; }
  .footer-inner { flex-direction: column; }
  .footer-inner > div:last-child { text-align: left; }
  .footer-inner > div:last-child .footer-links { justify-content: flex-start; }
  .alumni { display: block; overflow-x: auto; }
}

/* ---------- CV-derived additions ---------- */
.pub-summary { font-size: 15px; line-height: 1.4; color: #4a443c; font-style: italic; margin-top: 2px; }
.pub-award { font-size: 14.5px; color: var(--moss); font-weight: 500; }
.pub-media { font-size: 14.5px; color: var(--muted); }
.pub-media a { color: var(--loam); }

.dated { list-style: none; padding: 0; margin: 0; }
.dated li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 16px; line-height: 1.4; }
.dated li:last-child { border-bottom: 0; }
.dated li > span { color: var(--loam); font-size: 14.5px; font-weight: 500; padding-top: 1px; }

.press-item { display: grid; grid-template-columns: 100px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--rule); }
.press-year { font-family: var(--serif); font-size: 28px; color: var(--loam); line-height: 1.2; }
.press-item h2 { font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1.25; margin: 0; }
.press-item h2 a { color: var(--ink); text-decoration-color: var(--rule); }
.press-item h2 a:hover { color: var(--loam); }
.press-venue { margin: 2px 0 6px; color: var(--muted); }
.press-item p { margin: 0 0 8px; }
.press-outlets { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.press-outlets a { display: inline-block; padding: 3px 10px; border: 1px solid var(--rule); background: #fff; font-size: 15px; text-decoration: none; }
.press-outlets a:hover { border-color: var(--loam); }

.news li { grid-template-columns: 76px 1fr; }

@media (max-width: 760px) {
  .press-item { grid-template-columns: 1fr; gap: 6px; }
  .dated li { grid-template-columns: 78px 1fr; }
}

/* ---------- tools ---------- */
.tool-card {
  display: flex; align-items: center; gap: 24px; padding: 20px 24px; margin-bottom: 14px;
  background: #fff; border: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--loam); color: var(--ink); transform: translateY(-2px); }
.tool-card h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; margin: 0 0 2px; }
.tool-card p { margin: 0 0 6px; }
.tool-card p:last-child { color: #3a352e; }
.tools-list a::before { content: "→" !important; }
.tool-page { padding-bottom: 8px; }
.crumb { margin: 0 0 4px; font-size: 14px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.crumb a { text-decoration: none; }
.tool-meta { color: var(--muted); font-size: 16px; margin: -12px 0 0; }
.tool-page .more { margin: 8px 0 0; }
.tool-frame { margin-bottom: 40px; }
.tool-frame iframe {
  display: block; width: 100%; height: max(700px, calc(100vh - 32px)); border: 1px solid var(--rule); background: var(--paper);
}
@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } .tool-card:hover { transform: none; } }

/* institutional logos in the footer (white variants) */
.footer-logos { display: flex; align-items: center; gap: 20px; margin-top: 18px !important; }
.footer-logos a { display: block; line-height: 0; opacity: .92; }
.footer-logos a:hover { opacity: 1; }
.footer-logos a + a { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.2); }
.footer-logos img { width: auto; height: 44px; }
.footer-logos a + a img { height: 34px; }

/* very small phones */
@media (max-width: 380px) {
  .brand-inst { font-size: 9.5px; letter-spacing: 0.1em; }
  .site-nav { gap: 2px 12px; font-size: 13px; letter-spacing: 0.04em; }
}
