/* davidperryweb.com · Lathe
   Palette: warm turned wood, lathe iron, shaving curl, deep ink. */

:root {
  --bg: #e6d2b0;
  --panel: #faf3e4;
  --panel-deep: #ddc8a3;
  --ink: #2a2622;
  --muted: #5b5145;
  --iron: #484c52;
  --wood: #704d2c;
  --shave: #c09868;
  --line: #c8ad83;
  --footer: #2b2723;
  --footer-text: #ecdfc7;
  --footer-muted: #c8b79c;
  --display: 'Architects Daughter', 'Segoe Print', cursive;
  --body: 'Ledger', 'Iowan Old Style', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; }
.shell { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.kicker {
  font-family: var(--display);
  font-size: .82rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wood);
  margin: 0 0 .5rem;
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding-top: .7rem;
  padding-bottom: .7rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--display);
  font-size: 1.32rem;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .spiral-mark { width: 22px; height: 22px; color: var(--wood); flex: none; }
.main-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1.05rem; }
.main-nav a {
  color: var(--iron);
  text-decoration: none;
  font-size: .92rem;
  letter-spacing: .01em;
  padding: .18rem 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--ink); border-bottom-color: var(--shave); }
.main-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--wood); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--iron);
  color: var(--panel);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.2;
  padding: .78rem 1.3rem;
  border: 1px solid var(--iron);
  border-radius: 3px;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(43, 39, 35, .3);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--panel); transform: translateY(1px); box-shadow: 0 2px 0 rgba(43, 39, 35, .3); }
.btn-sm { font-size: .95rem; padding: .5rem 1rem; }
.main-nav a.btn { color: var(--panel); border-bottom-color: transparent; }
.main-nav a.btn:hover { color: var(--panel); background: var(--ink); border-bottom-color: transparent; }

/* hero */
.hero { position: relative; padding: 1.7rem 0 2.2rem; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(180deg, rgba(122, 85, 51, .06) 0 1px, transparent 1px 9px);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-title {
  font-size: clamp(2.9rem, 7.4vw, 5.2rem);
  letter-spacing: -.01em;
  margin: 0 0 .6rem;
}
.hero-tagline {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 36em;
  margin: 0 auto 1.3rem;
}
.hero-btn { margin-bottom: .2rem; }
.spindle-wrap { width: min(520px, 82%); color: var(--wood); margin: .6rem 0 0; }
.spindle { width: 100%; height: auto; display: block; }
.hero-photo {
  margin: .1rem 0 0;
  max-width: 310px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 170px 170px 6px 6px;
  padding: 11px;
  box-shadow: 0 18px 42px rgba(72, 58, 38, .13);
}
.hero-photo img { width: 100%; height: auto; border-radius: 160px 160px 3px 3px; }
.hero-media { display: flex; flex-direction: column; align-items: center; }
/* desktop: 左右两栏，主视觉照片放大到原生宽度 */
@media (min-width: 900px) {
  .hero { padding: 2.4rem 0 3rem; }
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    column-gap: 4rem;
    align-items: center;
    text-align: left;
  }
  .hero-copy { max-width: 34rem; }
  .hero-tagline { margin-left: 0; margin-right: 0; }
  .hero-btn { margin-top: .2rem; }
  .spindle-wrap { width: 340px; margin: 0 auto .8rem; }
  .hero-photo { max-width: 388px; margin: 0 auto; }
}
.photo-plinth {
  display: block;
  width: 74px;
  height: 9px;
  margin: 9px auto -3px;
  border-radius: 50%;
  background: var(--iron);
  opacity: .55;
}

/* sections */
.section { padding: 3.4rem 0; }
.section-last { padding-bottom: 4.2rem; }
.sec-head {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: .9rem;
  margin-bottom: .6rem;
}
.sec-head-gap { margin-top: 2.8rem; }
.sec-no {
  font-family: var(--display);
  font-size: .95rem;
  letter-spacing: .14em;
  color: var(--wood);
  padding-top: .28rem;
  min-width: 2.2rem;
}
.sec-title .kicker { margin-bottom: .25rem; }
.sec-title h2 { font-size: clamp(1.55rem, 2.5vw, 2.05rem); }
.section-sub { color: var(--muted); font-size: .98rem; max-width: 72ch; margin: 0 0 1.6rem; }

/* partners */
.partner-grid { display: grid; grid-template-columns: repeat(3, 250px); gap: 16px; }
.partner-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 250px;
  height: 150px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.partner-card:hover { border-color: var(--iron); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(72, 58, 38, .12); }
.partner-card img { max-width: 190px; max-height: 70px; width: auto; height: auto; object-fit: contain; }

/* quick profile */
.profile-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .2rem 3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--iron);
  padding: 1.4rem 1.9rem;
  box-shadow: 0 12px 30px rgba(72, 58, 38, .07);
}
.facts { margin: 0; }
.fact {
  display: grid;
  grid-template-columns: 8.8rem 1fr;
  gap: .8rem;
  padding: .62rem 0;
  border-bottom: 1px dashed #ddcbaa;
}
.facts .fact:last-child { border-bottom: 0; }
.fact dt {
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--wood);
  padding-top: .18rem;
}
.fact dd { margin: 0; font-size: .95rem; line-height: 1.5; }
.sheet-note { color: var(--muted); font-size: .85rem; margin: .9rem 0 0; }

/* about */
.about-grid { display: grid; grid-template-columns: 1.5fr .9fr; gap: 3.2rem; align-items: start; }
.about-text p { font-size: 1.01rem; line-height: 1.78; }
.about-photo {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 360px;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px;
  box-shadow: 0 14px 34px rgba(72, 58, 38, .1);
}
.about-photo img { width: 100%; height: auto; }
.era-tag {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--footer);
  color: var(--panel);
  font-size: .68rem;
  letter-spacing: .12em;
  padding: .2rem .5rem;
}

/* career stats */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.5rem 1.4rem 1.3rem;
}
.stat::before { content: ""; position: absolute; top: 0; left: 0; width: 46px; height: 3px; background: var(--iron); }
.stat-num { font-family: var(--display); font-size: clamp(2.3rem, 4.2vw, 3.15rem); line-height: 1; display: block; }
.stat-label { display: block; color: var(--muted); font-size: .88rem; line-height: 1.5; margin-top: .55rem; max-width: 26ch; }

/* gallery */
.gallery { border-bottom: 1px solid var(--line); }
.g-row {
  display: grid;
  grid-template-columns: 84px 1.3fr 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 18px 0;
  border-top: 1px dashed var(--line);
}
.g-row:first-child { border-top: 0; }
.g-era {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
  justify-self: center;
  font-family: var(--display);
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--wood);
  margin: 0;
}
.g-tile {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 300px;
  margin: 0;
  padding: 16px 16px 24px;
  background: var(--panel-deep);
  background-image: linear-gradient(to top, rgba(69, 74, 81, .13) 0 7px, rgba(69, 74, 81, 0) 7px);
  border: 1px solid var(--line);
}
.g-tile img { max-height: 260px; width: auto; max-width: 100%; height: auto; }

/* social */
.social-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.social-list li { border-bottom: 1px solid var(--line); }
.social-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem .2rem;
  text-decoration: none;
  color: var(--ink);
}
.social-list a:hover { background: rgba(122, 85, 51, .06); }
.s-platform { font-family: var(--display); font-size: 1rem; }
.s-handle { color: var(--muted); font-size: .92rem; }

/* footer */
.site-footer { background: var(--footer); color: var(--footer-text); margin-top: 1.6rem; padding: 2.1rem 0; }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.6rem; align-items: center; }
.footer-brand { display: flex; flex-direction: column; }
.brand-name { font-family: var(--display); font-size: 1.08rem; color: var(--footer-text); }
.brand-line { font-size: .83rem; color: var(--footer-muted); }
.language-nav { display: flex; flex-wrap: nowrap; justify-content: center; gap: .35rem .72rem; }
.language-nav a { color: var(--footer-muted); text-decoration: none; font-size: .84rem; white-space: nowrap; }
.language-nav a:hover { color: var(--footer-text); text-decoration: underline; text-underline-offset: 3px; }
.language-nav a[aria-current="page"] { color: var(--footer-text); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { margin: 0; text-align: right; font-size: .8rem; color: var(--footer-muted); justify-self: end; }

/* subpages */
.page-head { padding: 2.9rem 0 2.1rem; border-bottom: 1px solid var(--line); background: rgba(250, 243, 228, .45); }
.page-head-inner { display: grid; grid-template-columns: 1fr 220px; gap: 2rem; align-items: end; }
.page-head h1 { font-size: clamp(2.5rem, 5.4vw, 3.7rem); margin: 0 0 .8rem; }
.lede { color: var(--muted); font-size: 1.04rem; max-width: 64ch; margin: 0; }
.bed-rule {
  height: 15px;
  border-bottom: 2px solid var(--iron);
  background-image: repeating-linear-gradient(90deg, var(--iron) 0 1px, transparent 1px 13px);
  background-size: 100% 8px;
  background-position: bottom left;
  background-repeat: no-repeat;
  opacity: .7;
}

.bio-grid { display: grid; grid-template-columns: 1.55fr .8fr; gap: 3rem; align-items: start; }
.bio-block { margin-bottom: 2rem; }
.bio-block h2 { font-size: 1.3rem; margin-bottom: .7rem; }
.bio-block h2::before { content: ""; display: block; width: 34px; height: 2px; background: var(--wood); margin-bottom: .55rem; }
.bio-block p { font-size: 1rem; line-height: 1.8; }
.aside-card {
  position: sticky;
  top: 92px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--iron);
  padding: 1.3rem 1.35rem;
}
.aside-title { font-family: var(--display); font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wood); margin: 0 0 .5rem; }
.aside-card .fact { grid-template-columns: 6.4rem 1fr; }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 920px; }
.timeline li {
  display: grid;
  grid-template-columns: 7.4rem 1fr;
  gap: 1.2rem;
  position: relative;
  margin-left: 6px;
  padding: 0 0 1.35rem 1.7rem;
  border-left: 1px solid var(--line);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 4px;
  width: 18px;
  height: 18px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 8a2 2 0 1 1 3 1.7M8 8a4 4 0 1 1 6 3' fill='none' stroke='%237a5533' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 18px 18px;
}
.t-when { font-family: var(--display); font-size: .95rem; color: var(--wood); padding-top: .05rem; }
.timeline p { margin: 0; font-size: .98rem; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th {
  text-align: left;
  font-weight: 400;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wood);
  border-bottom: 2px solid var(--iron);
  padding: .5rem .7rem;
  white-space: nowrap;
}
td { padding: .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: rgba(122, 85, 51, .05); }
.c-year { width: 6.5rem; font-family: var(--display); white-space: nowrap; }
.c-title { color: var(--ink); }

.count-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.count { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--iron); padding: 1.1rem 1.2rem; }
.count-num { font-family: var(--display); font-size: 1.95rem; line-height: 1; display: block; }
.count-label { display: block; color: var(--muted); font-size: .82rem; line-height: 1.45; margin-top: .4rem; }
.count-note { color: var(--muted); font-size: .9rem; max-width: 80ch; margin: 1.2rem 0 0; }

.series-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.series-list li { background: var(--panel); border: 1px solid var(--line); padding: .35rem .7rem; font-size: .88rem; }

.faq-shell { max-width: 920px; }
.faq-list { border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 2.2rem 1.05rem 0;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.4;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+";
  position: absolute;
  right: .3rem;
  top: .85rem;
  font-family: var(--body);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--wood);
  transition: transform .18s ease;
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa-body p { color: var(--muted); max-width: 74ch; padding: .1rem 0 1.15rem; margin: 0; line-height: 1.75; }

.error-page { padding: 5.5rem 0 6.5rem; }
.error-page h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin: .4rem 0 1rem; }
.error-link { margin: 1.6rem 0 2.6rem; }
.error-page .spiral-mark { width: 56px; height: 56px; color: var(--wood); opacity: .8; }

a:focus-visible, summary:focus-visible { outline: 2px solid var(--wood); outline-offset: 3px; }

@media (max-width: 1040px) {
  .header-inner { gap: .6rem 1rem; }
  .main-nav { gap: .25rem .8rem; }
  .main-nav a { font-size: .87rem; }
  .about-grid { grid-template-columns: 1.3fr .9fr; gap: 2rem; }
  .bio-grid { grid-template-columns: 1.4fr .8fr; gap: 2rem; }
  .count-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; justify-items: start; gap: .9rem; }
  .language-nav { flex-wrap: wrap; justify-content: flex-start; }
  .footer-legal { text-align: left; }
}

@media (max-width: 880px) {
  .header-inner { flex-wrap: wrap; justify-content: flex-start; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
  .partner-card { width: 100%; height: auto; aspect-ratio: 5 / 3; }
  .partner-card img { max-width: 82%; max-height: 58px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { justify-self: start; margin-top: .4rem; }
  .profile-sheet { grid-template-columns: 1fr; gap: 0; }
  .bio-grid { grid-template-columns: 1fr; }
  .aside-card { position: static; }
  .page-head-inner { grid-template-columns: 1fr; }
  .bed-rule { display: none; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .g-row { grid-template-columns: 72px 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; justify-items: start; gap: .9rem; }
  .language-nav { flex-wrap: wrap; justify-content: flex-start; }
  .footer-legal { text-align: left; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .shell { padding: 0 18px; }
  .main-nav { gap: .2rem .65rem; }
  .main-nav a { font-size: .82rem; }
  .main-nav a.btn { font-size: .8rem; padding: .4rem .7rem; }
  .hero { padding-top: 1.4rem; }
  .hero-tagline { font-size: 1rem; }
  .hero-photo { max-width: 255px; }
  .section { padding: 2.5rem 0; }
  .sec-head { gap: .7rem; }
  .sec-no { min-width: 1.6rem; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .partner-card { aspect-ratio: 5 / 3; }
  .partner-card img { max-height: 46px; }
  .stat-row { grid-template-columns: 1fr; }
  .g-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g-era { grid-column: 1 / -1; writing-mode: horizontal-tb; transform: none; justify-self: start; margin: .3rem 0; }
  .g-tile { min-height: 210px; padding: 10px; }
  .g-tile img { max-height: 190px; }
  .fact { grid-template-columns: 6.6rem 1fr; gap: .5rem; }
  .profile-sheet { padding: 1.1rem 1rem; }
  .social-list a { flex-direction: column; gap: .1rem; }
  .timeline li { grid-template-columns: 5.2rem 1fr; gap: .7rem; padding-left: 1.2rem; }
  .t-when { font-size: .85rem; }
  .count-row { grid-template-columns: 1fr 1fr; }
  .page-head { padding-top: 2rem; }
  .faq-shell { max-width: none; }
  table { font-size: .86rem; }
  th, td { padding: .5rem; }
  .c-year { width: 4.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
