/* ═══════════════════════════════════════════
   Yitian Chen — Personal Site
   Pure CSS (no frameworks)
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500&display=swap');

/* ── Reset & base ── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:    #fafafa;
  --ink:   #1a1a1a;
  --mid:   #555555;
  --faint: #999999;
  --rule:  #e5e5e5;
  --warm:  #c47a4a;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  --max-w: 680px;

  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(196, 122, 74, 0.15);
}

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

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

ol, ul {
  list-style-position: inside;
}

/* ── Layout ── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 7rem 0;
  }
}

.divider {
  border: none;
  border-top: 1px solid var(--rule);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Navigation ── */

.nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav {
    padding: 2.5rem;
  }
}

.nav a {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  transition: color 0.3s;
}

.nav a:hover {
  color: var(--ink);
}

/* ── Under construction notice ── */

.construction-notice {
  position: fixed;
  top: 5.75rem;
  right: 2rem;
  z-index: 45;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(250, 250, 250, 0.96);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.construction-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .construction-notice {
    top: 7rem;
    right: 2.5rem;
  }
}

/* ── Hero ── */

.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.hero-photo {
  width: 12rem;
  height: 12rem;
  border-radius: 1rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-photo {
    width: 15rem;
    height: 15rem;
  }
}

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

.hero h1 {
  margin-top: 2.5rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.25rem;
  color: var(--ink);
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }
}

.hero .subtitle {
  margin-top: 1rem;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ── Scroll cue ── */

.scroll-cue {
  margin-top: 5rem;
  color: var(--faint);
  animation: float 2.8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ── Typography ── */

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.875rem;
  color: var(--ink);
}

.body-text {
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--mid);
}

.body-text + .body-text {
  margin-top: 1.25rem;
}

.body-text em.highlight {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
}

.body-text em.warm {
  color: var(--warm);
}

.label {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ── Tenets ── */

.tenets {
  margin-top: 3rem;
  text-align: center;
}

.tenets .label {
  margin-bottom: 1rem;
}

.tenets ol {
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--mid);
}

.tenets ol li + li {
  margin-top: 0.25rem;
}

/* ── Projects ── */

.project {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.project:last-child {
  border-bottom: none;
}

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.project-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
}

.project-status {
  flex-shrink: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.project-desc {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--mid);
}

.project-tags {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.project-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}

.project-link:hover {
  color: var(--warm);
  border-color: var(--warm);
}

/* ── Center link ── */

.center-link {
  margin-top: 2rem;
  text-align: center;
}

.center-link a {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  transition: color 0.3s;
}

.center-link a:hover {
  color: var(--ink);
}

/* ── Contact form ── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 0.875rem;
  color: var(--faint);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  outline: none;
  transition: border-color 0.3s;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: var(--ink);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--faint);
}

.form-submit {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn-submit {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0 0 2px 0;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}

.btn-submit:hover {
  color: var(--warm);
  border-color: var(--warm);
}

.form-note {
  font-size: 0.75rem;
  color: var(--faint);
}

/* ── Contact info ── */

.contact-info {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.contact-info a {
  font-size: 0.875rem;
  color: var(--faint);
  transition: color 0.3s;
}

.contact-info a:hover {
  color: var(--ink);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.social-links a {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--ink);
}

/* ── Footer ── */

.footer {
  padding: 4rem 0;
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── Fade-in animation ── */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Blog list ── */

.blog-page {
  padding-top: 8rem;
}

.blog-post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.blog-post-item:last-child {
  border-bottom: none;
}

.blog-post-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.blog-post-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
  transition: color 0.3s;
}

.blog-post-title:hover {
  color: var(--warm);
}

.blog-post-reading {
  flex-shrink: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.blog-post-summary {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--mid);
}

.blog-post-date {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--faint);
}

/* ── Blog article ── */

.article-page {
  padding-top: 8rem;
}

.article-meta {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.article-title {
  margin-top: 0.75rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 1.3;
  color: var(--ink);
}

@media (min-width: 768px) {
  .article-title {
    font-size: 2.25rem;
  }
}

.article-summary {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--mid);
}

.article-body {
  margin-top: 2.5rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--mid);
}

.article-body p + p {
  margin-top: 1.25rem;
}

.article-body strong {
  color: var(--ink);
  font-weight: 500;
}

.article-body em {
  font-style: italic;
}

.article-body ul,
.article-body ol {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  list-style-position: outside;
}

.article-body li {
  margin-top: 0.4rem;
}

.article-body a {
  color: var(--warm);
  border-bottom: 1px solid rgba(196, 122, 74, 0.3);
  transition: border-color 0.2s;
}

.article-body a:hover {
  border-bottom-color: var(--warm);
}

/* ── Spacing helpers ── */

.mt-3  { margin-top: 0.75rem; }
.mt-8  { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
