:root {
  --paper: #faf7f2;
  --ink: #1a1a18;
  --green: #2f4a3c;
  --line: rgba(26, 26, 24, 0.36);
  --soft-line: rgba(47, 74, 60, 0.26);
  --muted: rgba(26, 26, 24, 0.72);
  --serif: "Playfair Display", "Noto Serif TC", "Source Han Serif TC", "Songti TC", Georgia, serif;
  --sans: "Noto Sans TC", "Source Han Sans TC", "PingFang TC", "Heiti TC", Arial, sans-serif;
  --page-x: clamp(28px, 4.4vw, 88px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(47, 74, 60, 0.04), transparent 28%),
    linear-gradient(90deg, rgba(26, 26, 24, 0.018) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 7px 7px, auto;
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.section-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: rgba(250, 247, 242, 0.96);
}

.side-rail {
  position: absolute;
  inset: 6.5% auto 7% clamp(28px, 2.5vw, 48px);
  z-index: 2;
  width: 62px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  justify-items: center;
  color: var(--ink);
  font-family: var(--serif);
}

.side-rail i,
.about-rail::before {
  width: 1px;
  height: 100%;
  background: var(--line);
}

.side-rail b {
  writing-mode: vertical-rl;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.section-number {
  display: block;
  color: var(--green);
  font-family: var(--serif);
  font-size: clamp(116px, 11vw, 184px);
  line-height: 0.82;
  font-weight: 500;
}

.section-heading {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 24px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 2.1vw, 40px);
  line-height: 1;
  font-weight: 700;
}

.section-heading i,
.rule::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--line);
}

.star,
.star-rule span {
  color: var(--green);
  font-size: 24px;
}

.has-js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 680ms ease,
    transform 780ms cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(420px, 42%);
  padding-left: calc(var(--page-x) + 70px);
}

.hero-copy {
  min-width: 0;
  align-self: center;
  max-width: 950px;
  padding: 7vh clamp(34px, 6vw, 110px) 5vh 0;
}

.overline {
  margin: 0 0 70px;
  font-size: clamp(22px, 1.7vw, 34px);
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(72px, 6.2vw, 126px);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero .star-rule {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  margin: clamp(70px, 10vh, 132px) 0 clamp(56px, 8vh, 94px);
}

.tagline {
  margin: 0 0 48px;
  font-family: var(--serif);
  font-size: clamp(31px, 2.5vw, 51px);
  line-height: 1.35;
  font-weight: 700;
}

.subline {
  margin: 0 0 clamp(70px, 9vh, 118px);
  font-size: clamp(19px, 1.4vw, 27px);
}

.hero-nav {
  border-top: 1px solid var(--line);
  padding-top: 48px;
  display: flex;
  align-items: center;
  gap: clamp(30px, 3.7vw, 68px);
  font-family: var(--serif);
  font-size: clamp(21px, 1.4vw, 30px);
  font-weight: 700;
}

.hero-nav a:last-child,
.project-live span,
.read-more,
.more-link,
.footer-links span {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
}

.hero-photo {
  margin: 0;
  min-height: 100vh;
  border-left: 1px solid rgba(26, 26, 24, 0.14);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
}

.vertical-mark {
  position: absolute;
  right: clamp(28px, 2.5vw, 52px);
  bottom: 19%;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.12;
  font-weight: 700;
  text-align: center;
}

.about {
  display: grid;
  grid-template-columns: 18% minmax(0, 54%) 28%;
  align-items: stretch;
}

.about .section-number {
  align-self: start;
  margin: 13vh 0 0 clamp(48px, 4vw, 96px);
}

.about-rail {
  position: absolute;
  left: clamp(86px, 7vw, 140px);
  top: 38%;
  bottom: 9%;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: 16px;
}

.about-rail span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--green);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}

.about-body {
  align-self: center;
  padding: 0 clamp(40px, 4.8vw, 92px) 0 0;
}

.about-statement {
  margin: 86px 0 72px;
  max-width: 900px;
  font-family: var(--serif);
  font-size: clamp(39px, 3.1vw, 62px);
  line-height: 1.48;
  font-weight: 600;
}

.info-row {
  border-top: 1px solid var(--line);
  padding: 34px 0 50px;
}

.info-row:last-child {
  border-bottom: 1px solid var(--line);
}

.info-row h3 {
  margin: 0 0 26px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 24px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tags li {
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 8px 19px 9px;
  font-size: clamp(17px, 1.1vw, 23px);
  line-height: 1;
}

.info-row p {
  margin: 0;
  font-size: clamp(21px, 1.45vw, 30px);
  line-height: 1.65;
  font-weight: 600;
}

.about-image {
  margin: 0;
  height: 100%;
  border-left: 1px solid rgba(26, 26, 24, 0.12);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 20%;
  filter: grayscale(28%) saturate(0.74) contrast(0.92) brightness(1.08);
}

.projects {
  min-height: auto;
  padding: clamp(72px, 9vh, 106px) var(--page-x) 82px calc(var(--page-x) + 118px);
}

.projects-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: clamp(42px, 4vw, 72px);
  margin-bottom: 52px;
}

.projects-header .section-number {
  font-size: clamp(118px, 10vw, 176px);
}

.projects-header .section-heading {
  margin-top: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: clamp(24px, 2vw, 34px);
}

.project-card {
  border: 1px solid var(--line);
  display: flex;
  min-height: 760px;
  flex-direction: column;
  background: rgba(250, 247, 242, 0.65);
}

.project-shot {
  display: block;
  height: 352px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f6f4ef;
}

.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(100%) contrast(0.92) brightness(1.06);
  transition: filter 240ms ease, transform 600ms ease;
}

.project-card:hover .project-shot img {
  filter: grayscale(20%) contrast(0.98) brightness(1.02);
  transform: scale(1.025);
}

.project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(26px, 2vw, 38px);
}

.project-content h3 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(38px, 2.6vw, 54px);
  line-height: 1;
  font-weight: 600;
}

.project-subtitle {
  margin: 0 0 32px;
  font-size: clamp(21px, 1.4vw, 28px);
  line-height: 1.35;
}

.project-desc {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 28px 0;
  font-size: clamp(17px, 1.05vw, 21px);
  line-height: 1.8;
}

.project-live {
  margin-top: auto;
  padding-top: 28px;
  font-family: var(--serif);
  font-size: clamp(17px, 1.05vw, 21px);
}

.more-link {
  display: inline-block;
  margin-top: 34px;
  font-size: 20px;
  font-weight: 600;
}

.work {
  display: grid;
  grid-template-columns: 42% repeat(3, 1fr);
  min-height: 940px;
  padding-left: calc(var(--page-x) + 86px);
  border-top: 1px solid rgba(26, 26, 24, 0.12);
}

.work-intro {
  position: relative;
  z-index: 1;
  padding: 14vh clamp(46px, 4vw, 72px) 0 0;
}

.work-intro h2,
.writing-list h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(78px, 7.1vw, 136px);
  line-height: 0.95;
  font-weight: 500;
}

.work-intro .star-rule {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin: 56px 0 68px;
}

.work-intro p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 2.1vw, 42px);
  line-height: 1.55;
  font-weight: 600;
}

.work-watermark {
  position: absolute;
  left: 2.4vw;
  bottom: -14vw;
  color: var(--green);
  opacity: 0.92;
  font-family: var(--serif);
  font-size: clamp(360px, 34vw, 650px);
  line-height: 0.8;
  pointer-events: none;
  will-change: transform;
}

.work::after {
  content: "";
  position: absolute;
  left: 36%;
  bottom: 0;
  width: 32%;
  height: 46%;
  background:
    linear-gradient(rgba(250, 247, 242, 0.08), rgba(250, 247, 242, 0.9)),
    url("../assets/portrait.jpg") center 24% / cover;
  opacity: 0.12;
  filter: grayscale(100%) contrast(0.9);
}

.principles {
  display: contents;
}

.principle {
  z-index: 1;
  min-height: 74%;
  padding: 16vh clamp(28px, 2.1vw, 42px) 0;
  border-left: 1px solid var(--line);
}

.principle span {
  display: inline-block;
  color: var(--green);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.principle h3 {
  margin: 58px 0 30px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(31px, 2.25vw, 46px);
  line-height: 1.42;
}

.principle p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 1.55vw, 31px);
  line-height: 1.74;
  font-weight: 500;
}

.work-footer {
  position: absolute;
  right: var(--page-x);
  bottom: 9vh;
  left: 66.5%;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding-top: 38px;
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--green);
}

.work-footer b {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.42em;
}

.work-footer i {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.work-footer i.active {
  background: var(--green);
}

.writing {
  display: grid;
  grid-template-columns: minmax(0, 72%) 28%;
  min-height: 940px;
  padding: 11vh 0 9vh calc(var(--page-x) + 104px);
}

.writing-list {
  padding-right: clamp(60px, 6vw, 108px);
}

.writing-list h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 46px;
}

.writing-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 46px;
  border-bottom: 1px solid var(--line);
  padding: 54px 0 44px;
}

.writing-item time {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(16px, 1.1vw, 22px);
  letter-spacing: 0.09em;
}

.writing-item h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 2.1vw, 40px);
  line-height: 1.38;
}

.writing-item h3 a:hover {
  color: var(--green);
}

.writing-item p {
  margin: 0 0 18px;
  font-size: clamp(17px, 1.1vw, 22px);
  line-height: 1.65;
}

.read-more {
  font-size: 18px;
  font-weight: 700;
}

.writing-aside {
  border-left: 1px solid var(--line);
  padding: 2vh var(--page-x) 0 clamp(42px, 3.6vw, 68px);
}

.writing-aside .section-number {
  font-size: clamp(128px, 11vw, 196px);
}

.writing-aside .compact {
  grid-template-columns: auto 1fr;
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
  margin-bottom: 34px;
}

.writing-aside figure {
  margin: 0;
  height: 52vh;
  min-height: 420px;
  overflow: hidden;
  border-left: 1px solid rgba(26, 26, 24, 0.08);
}

.writing-aside img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 28%;
  filter: grayscale(100%) contrast(0.88) brightness(1.08);
}

.subscribe {
  min-height: 820px;
  display: grid;
  grid-template-columns: 11% 89%;
}

.subscribe-image {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

.subscribe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 9% 20%;
  filter: grayscale(35%) saturate(0.72) contrast(0.9) brightness(1.12);
}

.subscribe-content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  padding: 6vh var(--page-x) 42px;
  text-align: center;
}

.subscribe-top {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding-top: 20px;
  font-family: var(--serif);
  font-size: 25px;
}

.subscribe-top span:nth-child(2) {
  color: var(--green);
}

.subscribe h2 {
  margin: 0 auto 30px;
  max-width: 1050px;
  font-family: var(--serif);
  font-size: clamp(56px, 5.7vw, 112px);
  line-height: 1.18;
}

.subscribe p {
  margin: 0 auto 44px;
  max-width: 770px;
  font-size: clamp(20px, 1.35vw, 28px);
  line-height: 1.75;
  font-weight: 600;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 374px;
  min-height: 68px;
  padding: 17px 32px;
  background: var(--green);
  color: var(--paper);
  font-size: 27px;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.18);
}

.substack-url {
  display: block;
  width: min(420px, 100%);
  margin: 28px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.16em;
}

.subscribe footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  text-align: right;
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.08em;
}

.footer {
  min-height: 940px;
  display: grid;
  grid-template-columns: minmax(0, 43%) minmax(470px, 46%) minmax(120px, 11%);
  grid-template-rows: 1fr auto;
  gap: 0;
  padding: 18vh 0 0 var(--page-x);
}

.footer::before,
.footer::after {
  content: "";
  position: absolute;
  left: var(--page-x);
  right: 0;
  height: 1px;
  background: var(--line);
}

.footer::before {
  top: 18%;
}

.footer::after {
  bottom: 16%;
}

.footer-star {
  position: absolute;
  left: var(--page-x);
  top: 12.5%;
  color: var(--green);
  font-size: 27px;
}

.footer-brand {
  align-self: center;
  padding-right: clamp(38px, 4vw, 82px);
}

.footer-brand h2 {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(60px, 5vw, 102px);
  line-height: 1;
  font-weight: 500;
}

.footer-brand p {
  margin: 0;
  font-size: clamp(20px, 1.5vw, 29px);
  letter-spacing: 0.12em;
}

.footer-links {
  align-self: center;
  border-left: 1px solid var(--line);
  padding-left: clamp(52px, 5vw, 90px);
  font-style: normal;
}

.footer-links a {
  display: grid;
  grid-template-columns: 160px 1px 1fr;
  gap: 34px;
  align-items: center;
  min-height: 108px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(20px, 1.35vw, 27px);
}

.footer-links a:first-child {
  border-top: 0;
}

.footer-links a::before {
  content: "";
  order: 2;
  width: 1px;
  height: 42px;
  background: var(--line);
}

.footer-links span {
  order: 1;
  text-decoration: none;
  font-weight: 600;
}

.footer-links b {
  order: 3;
  font-weight: 500;
}

.footer-image {
  margin: 0;
  align-self: center;
  height: 66vh;
  min-height: 580px;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.footer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 18%;
  filter: grayscale(100%) contrast(0.9) brightness(1.08);
}

.copyright {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  padding: 32px 0;
  color: var(--green);
  font-size: 33px;
}

.copyright span {
  color: var(--ink);
  margin-left: 48px;
  font-size: 21px;
  letter-spacing: 0.08em;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .hero-photo {
    grid-row: 1;
    min-height: 58vh;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-photo img {
    object-position: 52% 28%;
  }

  .hero-copy {
    padding: 54px var(--page-x) 64px;
  }

  .hero h1 {
    white-space: normal;
  }

  .side-rail,
  .vertical-mark,
  .about-rail {
    display: none;
  }

  .about,
  .writing,
  .subscribe,
  .footer {
    grid-template-columns: 1fr;
    padding-left: var(--page-x);
    padding-right: var(--page-x);
  }

  .about .section-number {
    margin: 70px 0 0;
  }

  .about-body,
  .writing-list {
    padding-right: 0;
  }

  .about-image,
  .writing-aside figure,
  .footer-image {
    display: none;
  }

  .projects {
    padding-left: var(--page-x);
  }

  .work {
    display: block;
    min-height: auto;
    padding: 78px var(--page-x);
  }

  .work-intro {
    padding: 0;
  }

  .principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 54px;
    border-top: 1px solid var(--line);
  }

  .principle {
    min-height: 0;
    padding: 44px 28px;
  }

  .work-footer {
    position: static;
    margin-top: 42px;
  }

  .writing {
    padding-top: 74px;
  }

  .writing-aside {
    order: -1;
    border-left: 0;
    padding: 0 0 38px;
  }

  .subscribe {
    padding: 0;
  }

  .subscribe-image {
    height: 260px;
  }

  .subscribe-content {
    padding-left: var(--page-x);
    padding-right: var(--page-x);
  }

  .footer {
    padding-top: 96px;
  }

  .footer-links {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --page-x: 22px;
  }

  .section-shell {
    min-height: auto;
  }

  .hero-photo {
    min-height: 48vh;
  }

  .overline {
    margin-bottom: 44px;
    font-size: 19px;
  }

  .hero h1 {
    font-size: clamp(54px, 16vw, 76px);
  }

  .hero .star-rule {
    margin: 48px 0;
  }

  .tagline {
    font-size: 29px;
  }

  .subline {
    margin-bottom: 50px;
  }

  .hero-nav {
    flex-wrap: wrap;
    gap: 18px 24px;
    padding-top: 30px;
    font-size: 21px;
  }

  .about-statement {
    margin: 48px 0;
    font-size: 34px;
  }

  .projects-header {
    display: block;
  }

  .projects-header .section-heading {
    margin: 28px 0 0;
  }

  .project-card {
    min-height: 0;
  }

  .project-shot {
    height: 250px;
  }

  .work-intro h2,
  .writing-list h2 {
    font-size: 64px;
  }

  .work-watermark {
    left: -20px;
    bottom: 44%;
    font-size: 250px;
    opacity: 0.11;
  }

  .principles {
    display: block;
  }

  .principle {
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 34px 0;
  }

  .writing-item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 36px 0;
  }

  .writing-aside .section-number {
    font-size: 116px;
  }

  .subscribe h2 {
    font-size: clamp(44px, 12vw, 62px);
  }

  .cta {
    min-width: 0;
    width: 100%;
    font-size: 22px;
  }

  .subscribe footer {
    text-align: left;
  }

  .footer::before,
  .footer::after {
    left: var(--page-x);
    right: var(--page-x);
  }

  .footer-brand h2 {
    font-size: 54px;
  }

  .footer-links a {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 94px;
    word-break: break-word;
  }

  .footer-links a::before {
    display: none;
  }

  .copyright span {
    display: block;
    margin: 18px 0 0;
    font-size: 16px;
    line-height: 1.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }

  .has-js .reveal {
    opacity: 1;
    transform: none;
  }
}
