/* ==========================================================================
   Ciallo Network · 个人主页
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --bg-glow-a: #ffe4e8;
  --bg-glow-b: #e6f0e9;
  --surface: #ffffff;
  --surface-2: #fbf7f0;
  --ink: #191512;
  --ink-2: #4f4840;
  --ink-3: #6f6559;
  --line: rgba(25, 21, 18, 0.12);
  --line-strong: rgba(25, 21, 18, 0.22);
  --accent: #e2415b;
  --accent-2: #bd2f47;
  --accent-soft: #fbe1e5;
  --toast-bg: #191512;
  --toast-ink: #f8f1e6;
  --shadow-sm: 0 2px 10px rgba(25, 21, 18, 0.05);
  --shadow-md: 0 18px 40px -26px rgba(25, 21, 18, 0.45);
  --shadow-lg: 0 44px 90px -52px rgba(25, 21, 18, 0.55);
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 34px;
  --wrap: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI Symbol", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12100e;
  --bg-glow-a: rgba(226, 65, 91, 0.18);
  --bg-glow-b: rgba(47, 139, 118, 0.14);
  --surface: #1d1916;
  --surface-2: #221d19;
  --ink: #f5eee3;
  --ink-2: #c9bfb1;
  --ink-3: #998e80;
  --line: rgba(245, 238, 227, 0.13);
  --line-strong: rgba(245, 238, 227, 0.26);
  --accent: #ff647c;
  --accent-2: #ff8d9e;
  --accent-soft: rgba(255, 100, 124, 0.16);
  --toast-bg: #f5eee3;
  --toast-ink: #191512;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 40px -26px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 44px 90px -52px rgba(0, 0, 0, 0.95);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 620px at 8% -8%, var(--bg-glow-a) 0%, transparent 62%),
    radial-gradient(820px 560px at 100% 4%, var(--bg-glow-b) 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#main {
  flex: 1 0 auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.25) 55%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.25) 55%, transparent 85%);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  width: min(var(--wrap), 100% - 40px);
  margin-inline: auto;
}

.skip-link {
  position: fixed;  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-size: 0.9rem;
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* 回到顶部的锚点：不能挂在 sticky header 上，否则浏览器只会小幅滚动 */
.anchor-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* ============================ buttons ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s var(--ease),
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    color 0.18s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 28px -14px rgba(226, 65, 91, 0.75);
}

.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -16px rgba(226, 65, 91, 0.8);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.88rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: rotate(-12deg);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="light"] .i-sun {
  display: none;
}

html[data-theme="dark"] .i-moon {
  display: none;
}

/* ============================ header ============================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(25, 21, 18, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  --mark-h: 48px;
  display: grid;
  place-items: center;
  height: var(--mark-h);
  flex: none;
  background: transparent;
}

.brand-mark img {
  display: block;
  height: var(--mark-h);
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

html[data-theme="dark"] .brand-mark img {
  filter: invert(1);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.02;
}

.brand-text strong {
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-left: auto;
}

/* ============================ 置顶 ============================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pinned-section {
  padding-block: clamp(20px, 2.4vw, 30px) clamp(14px, 1.8vw, 18px);
}

.section {
  padding-block: clamp(14px, 2vw, 24px);
}

.pin-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid rgba(226, 65, 91, 0.28);
  border-radius: var(--r-xl);
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(226, 65, 91, 0.12), transparent 70%),
    linear-gradient(150deg, #fffdfa 0%, #fdf2ef 58%, #fbe5ea 100%);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.pin-copy {
  min-width: 0;
}

.pin-code {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

html[data-theme="dark"] .pin-card {
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(255, 100, 124, 0.16), transparent 70%),
    linear-gradient(150deg, #1f1a17 0%, #241b1b 58%, #2c1b20 100%);
  border-color: rgba(255, 100, 124, 0.3);
}

.pin-tape {
  position: absolute;
  top: -13px;
  left: 48px;
  width: 132px;
  height: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  transform: rotate(-3deg);
}

.pin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 20px -12px rgba(226, 65, 91, 0.95);
}

.pin-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pin-meta {
  font-size: 0.76rem;
  color: var(--ink-3);
}

.pin-card h2 {
  margin-top: 12px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.pin-desc {
  max-width: 34em;
  margin-top: 8px;
  font-size: 0.93rem;
  color: var(--ink-2);
}

.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: #171310;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 44px -30px rgba(0, 0, 0, 0.85);
}

.code {
  flex: 1;
  min-width: 0;
  padding-block: 2px;
  overflow-x: auto;
  color: #f8f1e6;
  font-family: var(--mono);
  font-size: clamp(0.92rem, 1.6vw, 1.12rem);
  letter-spacing: 0.02em;
  white-space: nowrap;
  scrollbar-width: thin;
}

.code::selection {
  background: var(--accent);
  color: #fff;
}

.code.is-selected {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.btn-copy {
  flex: none;
}

.pin-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  font-weight: 650;
  text-decoration: none;
}

.text-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================ links ============================ */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  letter-spacing: -0.03em;
}

.section-head p {
  font-size: 0.82rem;
  color: var(--ink-3);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 65, 91, 0.36);
  box-shadow: var(--shadow-md);
}

.link-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-2);
}

.link-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 1px;
}

.link-body strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.link-url {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.link-body em {
  margin-top: 3px;
  font-style: normal;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-3);
}

.link-card .i-arrow {
  width: 18px;
  height: 18px;
  flex: none;
  margin-left: auto;
  margin-top: 3px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease), stroke 0.25s;
}

.link-card:hover .i-arrow {
  transform: translateX(4px);
  stroke: var(--accent);
}

/* ============================ services ============================ */

.line-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.line-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.line-card:hover {
  transform: translateY(-3px);
  border-color: rgba(226, 65, 91, 0.36);
  box-shadow: var(--shadow-md);
}

.line-flag {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.line-card h3 {
  margin-top: 4px;
  font-size: 1rem;
}

.line-card p {
  font-size: 0.76rem;
  color: var(--ink-3);
}

.line-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-2);
  transition: color 0.2s;
}

.line-cta svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}

.line-card:hover .line-cta {
  color: var(--accent-2);
}

.line-card:hover .line-cta svg {
  transform: translateX(3px);
}

/* ============================ footer ============================ */

.site-footer {
  margin-top: auto;
  padding-block: 10px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  font-size: 0.74rem;
  color: var(--ink-3);
}


/* ============================ toast / reveal ============================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  max-width: min(92vw, 560px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-size: 0.86rem;
  text-align: center;
  box-shadow: 0 24px 44px -22px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 160%);
  transition: transform 0.36s var(--ease), opacity 0.28s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.link-grid .reveal:nth-child(2),
.line-grid .reveal:nth-child(2) {
  transition-delay: 0.07s;
}

.line-grid .reveal:nth-child(3) {
  transition-delay: 0.14s;
}

.line-grid .reveal:nth-child(4) {
  transition-delay: 0.21s;
}

/* ============================ responsive ============================ */

@media (max-width: 1000px) {
  .pin-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 80px;
  }

  .wrap {
    width: min(var(--wrap), 100% - 32px);
  }

  .header-inner {
    height: 60px;
    gap: 12px;
  }

  .brand-mark {
    --mark-h: 40px;
  }

  .link-grid,
  .line-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .code-box {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .code {
    font-size: clamp(0.92rem, 4.4vw, 1.2rem);
  }

  .btn-copy {
    width: 100%;
  }

  .pin-tape {
    left: 26px;
    width: 104px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .pin-badge {
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}
