/*
 * Studio Wenkai is licensed under the SIL Open Font License, Version 1.1.
 * The full license is available at assets/fonts/OFL.txt.
 */
@font-face {
  font-family: "Studio Wenkai";
  src: url("assets/fonts/studio-wenkai-tc.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f9fc;
  --wash: #a6c6e1;
  --ink: #000000;
  --primary: #000000;
  --soft-ink: #000000;
  --rule: #b3cbe0;
  --focus: #2469a2;
  --selection: #d6e8f7;
  --selection-ink: #000000;
  --scroll-thumb: #8aa9c5;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--scroll-thumb) var(--paper);
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--wash) url("assets/watercolor-paper.png") center / cover;
  background-blend-mode: luminosity;
  color: var(--ink);
  font-family: "Studio Wenkai", "Noto Serif CJK TC", Georgia, serif;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: #d6e8f755;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 8px; }
::selection { background: var(--selection); color: var(--selection-ink); }

.page {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: clamp(24px, 5vw, 64px);
  display: flex;
  flex-direction: column;
}

.masthead {
  padding-top: max(44px, env(safe-area-inset-top));
  text-align: center;
}

.wordmark {
  display: inline-block;
  margin: 0;
  color: var(--primary);
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1.3;
}

main { padding-block: clamp(56px, 6vw, 88px) clamp(64px, 7vw, 96px); }
.intro { text-align: center; }

h1 {
  margin: 0;
  font-size: clamp(27px, 3.6vw, 44px);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: .035em;
  text-wrap: balance;
}

h1 span { display: block; }
.gallery { margin-top: clamp(60px, 7vw, 96px); }

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.projects li { min-width: 0; }

.project {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 8px;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
}

.logo-space {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 144px;
  margin-bottom: 28px;
}

.project-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 108px;
  transition: transform 260ms var(--ease);
}

.project-logo.house { height: 100px; }
.project-logo.wentian { height: 132px; margin-top: 13px; }

.project-title {
  margin: 0;
  color: var(--primary);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

.project-title.english {
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
}

.project-note {
  max-width: 18em;
  margin: 17px 0 0;
  color: var(--soft-ink);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .015em;
  text-wrap: balance;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: auto;
  padding-bottom: max(36px, env(safe-area-inset-bottom));
}

footer::before, footer::after {
  content: "";
  width: min(112px, 12vw);
  height: 1px;
  background: var(--rule);
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--primary);
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: 17px;
  font-style: italic;
  text-decoration-color: var(--rule);
}

.project:focus-visible .project-title,
.contact:focus-visible { text-decoration-color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .project:hover .project-logo { transform: translateY(-5px); }
  .project:hover .project-title,
  .contact:hover { text-decoration-color: var(--ink); }
}

@media (prefers-reduced-motion: no-preference) {
  .gallery { animation: gallery-arrive 900ms var(--ease) both; }
  @keyframes gallery-arrive {
    from { opacity: .95; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 900px) {
  .projects { gap: 20px; }
  .project { padding-inline: 0; }
  .project-title { font-size: 23px; }
  .project-note { font-size: 15px; }
}

@media (max-width: 700px) {
  body { background-size: auto 1100px; background-repeat: repeat-y; }
  .page {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  .masthead { padding-top: max(32px, env(safe-area-inset-top)); }
  .wordmark { font-size: 30px; }
  main { padding-block: 44px 64px; }
  h1 { font-size: clamp(23px, 4.8vw, 32px); line-height: 1.75; letter-spacing: .015em; }
  .gallery { margin-top: 48px; }
  .projects {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    max-width: 340px;
    margin-inline: auto;
  }
  .logo-space { height: 116px; margin-bottom: 19px; }
  .project-logo { height: 94px; }
  .project-logo.house { height: 88px; }
  .project-logo.wentian { height: 116px; margin-top: 11px; }
  .project-title { font-size: 25px; }
  .project-note { margin-top: 14px; font-size: 16px; max-width: 17em; }
  footer { gap: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  footer::before, footer::after { width: 28px; }
  .contact { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-logo { transition: none; }
  .project:hover .project-logo { transform: none; }
}
