/*
  File purpose: visual system and responsive layout for Alvaro's static personal site.
  文件用途：为 Alvaro 的静态个人网站提供视觉系统和响应式布局。
*/

:root {
  --color-paper: #f7f2e8;
  --color-surface: #fffaf1;
  --color-ink: #1e211f;
  --color-muted: #60675f;
  --color-line: #d8d0c1;
  --color-green: #607a64;
  --color-blue: #5f84a2;
  --color-gold: #b88636;
  --shadow-soft: 0 18px 45px rgba(30, 33, 31, 0.08);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

/* Site shell component: constrains the page without turning sections into cards. */
/* 站点外壳组件：约束页面宽度，但不把页面区块做成卡片。 */
.site-shell {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

/* Header component: compact navigation for repeated scanning. */
/* 头部组件：紧凑导航，方便反复浏览。 */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  gap: 24px;
}

.brand-link {
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.site-nav a,
.text-link {
  border-bottom: 1px solid transparent;
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease;
}

.site-nav a {
  padding: 8px 0;
  margin-left: 18px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  border-color: currentColor;
  color: var(--color-ink);
}

/* Intro component: first-viewport personal signal with the local visual asset. */
/* 简介组件：首屏呈现个人信号和本地视觉资产。 */
.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  align-items: center;
  min-height: calc(100vh - 112px);
  gap: 56px;
  padding: 40px 0 72px;
}

.intro-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--color-green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3.3rem, 5rem, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.intro-text {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--color-muted);
  font-size: 1.08rem;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}

.intro-visual {
  width: min(100%, 420px);
  margin: 0;
  justify-self: end;
}

.intro-visual img {
  aspect-ratio: 1;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  object-fit: cover;
}

.intro-visual figcaption {
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

/* Content section component: full-width rhythm inside the constrained shell. */
/* 内容区块组件：在页面宽度内提供稳定阅读节奏。 */
.content-section {
  border-top: 1px solid var(--color-line);
  padding: 76px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 34px;
}

.thought-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.thought-list li {
  min-height: 190px;
  border-left: 4px solid var(--color-gold);
  padding: 4px 22px 0;
}

.thought-list span {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.28;
}

.thought-list p,
.work-card p,
.contact-section p {
  color: var(--color-muted);
}

/* Work card component: repeated items use cards because they are comparable artifacts. */
/* 作品卡片组件：重复项目使用卡片，便于横向比较。 */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.work-card {
  min-height: 260px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
  padding: 22px;
}

.work-kicker {
  margin: 0 0 30px;
  color: var(--color-blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Contact component: keeps the public contact path narrow and deliberate. */
/* 联系组件：保持公开联系路径克制且明确。 */
.contact-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: start;
  gap: 28px;
  border-top: 1px solid var(--color-line);
  padding: 76px 0;
}

.external-link::after {
  content: "↗";
  margin-left: 0.35em;
  color: var(--color-gold);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--color-line);
  padding: 28px 0 44px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 24px, var(--max-width));
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 18px 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .site-nav a {
    margin-left: 0;
    margin-right: 16px;
  }

  .intro-section {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 34px;
    padding: 30px 0 56px;
  }

  h1 {
    max-width: 12ch;
    font-size: 3.15rem;
  }

  h2 {
    font-size: 1.85rem;
  }

  .intro-visual {
    width: min(100%, 360px);
    justify-self: start;
  }

  .section-heading,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .thought-list,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .thought-list li,
  .work-card {
    min-height: auto;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.65rem;
  }

  .intro-text {
    font-size: 1rem;
  }

  .work-card {
    padding: 18px;
  }
}

