/* linjirong.com — site skeleton (Phase 1)
   minimal, clean, no JS, no animations yet. Phase 2 brings GSAP + Lenis. */

:root {
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e0;
  --max: 1200px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Source Han Sans SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* Nav */
.site-nav {
  padding: 1.5rem 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
}
.brand { text-decoration: none; display: none; }

.hero-name-container { position: relative; display: inline-block; }
.hero-name { transition: opacity 0.4s ease; }
.hero-sig {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  width: clamp(500px, 30vw, 1000px);
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.hero-sig.active {
  opacity: 1;
  animation: sig-write 1.5s ease-in-out forwards;
}
@keyframes sig-write {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.nav-links a {
  color: var(--fg);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.nav-links a:hover {
  opacity: 0.6;
}

/* Hero */
.hero {
  padding: 6rem 5vw 3rem;
  max-width: var(--max);
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(3.5rem, 12vw, 9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.05em;
  font-family: -apple-system, "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", sans-serif;
}
.tagline {
  margin-top: 2rem;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--muted);
  max-width: 42ch;
  line-height: 1.55;
}

/* Generic section */
section {
  padding: 3rem 5vw;
  max-width: var(--max);
  margin: 0 auto;
}
section h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
section p { color: var(--muted); max-width: 60ch; }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  display: block;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card:hover {
  border-color: var(--fg);
  transform: translateY(-2px);
  text-decoration: none;
}
.card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; }
.card .desc { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.card .meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

/* Quick links (mono, underline) */
.quick-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.quick-links a {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}
.quick-links a:hover { text-decoration: none; }

/* Footer */
.site-footer {
  margin-top: 6rem;
  padding: 4rem 5vw 3rem;
  border-top: 1px solid var(--line);
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.footer-name {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.9;
}
.footer-meta {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Folder-tab 「品」 SVG — left-bottom 口 is a folder, others stay square */
.pin {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  vertical-align: -0.08em;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linejoin: miter;
}
.pin.heavy { stroke-width: 4; }

/* Accessibility */
.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;
}

/* Reduced motion — respect user preference even before Phase 2 lands */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Phase 2: reveal system + hero floats + new sections ---- */

/* Reveal only kicks in when JS marks the page anim-capable
   (inline <head> script adds .has-anim if reduce-motion is off) */
.has-anim [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}
.has-anim [data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero floats — three slow shapes drifting behind the name */
.hero { position: relative; overflow: hidden; }
.floats { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.float {
  position: absolute;
  background: var(--fg);
  opacity: 0.045;
  border-radius: 50%;
}
.float.f1 { width: clamp(120px, 18vw, 240px); aspect-ratio: 1; top: 6%; right: 5%; }
.float.f2 { width: clamp(80px, 12vw, 160px); aspect-ratio: 1; bottom: 10%; left: 4%; }
.float.f3 {
  width: clamp(60px, 8vw, 110px); aspect-ratio: 1;
  top: 38%; left: 38%;
  border-radius: 4px;
  transform: rotate(15deg);
}
.hero > *:not(.floats) { position: relative; z-index: 1; }

/* Section title unified */
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

/* Directions list */
.direction-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.direction-list li {
  padding: 1.5rem;
  border-left: 2px solid var(--fg);
  background: #fff;
}
.direction-list li strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.direction-list li span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Featured grid — gradient preview brightens on hover (placeholder for real shots) */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  color: inherit;
}
.feature-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: var(--fg);
  box-shadow: 0 14px 32px -18px rgba(0, 0, 0, 0.18);
}
.feature-preview {
  aspect-ratio: 4 / 3;
  transition: filter 0.45s ease, transform 0.45s ease;
}
.feature-card:hover .feature-preview {
  filter: saturate(1.2) brightness(1.05);
  transform: scale(1.02);
}
.gradient-1 { background: linear-gradient(135deg, #2b3a55, #5d7693); }
.gradient-2 { background: linear-gradient(135deg, #6f5440, #c0916e); }
.gradient-3 { background: linear-gradient(135deg, #d8c8a0, #c89884); }
.feature-body { padding: 1.25rem; }
.feature-body h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature-body p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}
.feature-meta {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.feature-card.pending { opacity: 0.85; cursor: default; }
.feature-card.pending:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}
.feature-card.pending:hover .feature-preview { transform: none; filter: none; }

/* About teaser */
.teaser-body {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 48ch;
  color: var(--fg);
}
.more-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 3px;
}
.more-link:hover { text-decoration: none; }

/* Contact */
.contact-list { list-style: none; max-width: 480px; }
.contact-list li {
  display: flex;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.contact-list .key {
  width: 6rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.contact-list .val { font-size: 0.98rem; }

/* Big landing footer (homepage-level大字落款) */
.site-footer.big { margin-top: 7rem; padding-top: 5rem; }
.site-footer.big .footer-name {
  font-size: clamp(4rem, 14vw, 11rem);
  line-height: 0.85;
}

/* ---- Phase 2.5b: /work/ ceremony entrance — real text 品 + folder overlay on hover ---- */

.zuopin-stage {
  min-height: calc(100vh - 12rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 5vw 6rem;
  max-width: var(--max);
  margin: 0 auto;
}
.zuopin-link {
  display: block;
  text-align: center;
  color: inherit;
}
.zuopin-link:hover { text-decoration: none; }
.zuopin-link:focus { outline: none; }
.zuopin-link:focus-visible { outline: 2px dashed var(--fg); outline-offset: 8px; border-radius: 4px; }

.zuopin-text {
  font-size: clamp(7rem, 24vw, 18rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  display: inline-block;
}

/* The 「品」 character renders as plain text — looks completely normal at rest.
   On hover near it, an overlay folder appears at its bottom-left 口 position. */
.pin-anchor {
  position: relative;
  display: inline-block;
}

/* Folder sits over the bottom-left 口 of the rendered 品 character.
   Coordinates measured against the .pin-anchor box (which equals the 品 glyph box).
   For PingFang/Source Han at weight 700, bottom-left 口 is roughly:
   left 6% — width 38%, bottom 8% — height 36%. */
.folder-3d {
  position: absolute;
  left: 6%;
  width: 38%;
  bottom: 8%;
  height: 36%;
  perspective: 1200px;
  perspective-origin: 50% 30%;
  transform-style: preserve-3d;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.has-anim .pin-anchor:hover .folder-3d,
.has-anim .zuopin-link:focus-visible .folder-3d {
  opacity: 1;
}

/* Back panel — sits in place, includes a small tab notch at top-left to read as a manila folder */
.folder-back {
  position: absolute;
  inset: 0;
  background: var(--fg);
  border-radius: 3% 3% 4% 4%;
  z-index: 1;
}
.folder-back::before {
  content: '';
  position: absolute;
  left: 6%;
  top: -14%;
  width: 36%;
  height: 18%;
  background: var(--fg);
  border-radius: 3px 3px 0 0;
}

/* Papers — visible behind front face once front opens. They droop downward out of the folder. */
.folder-paper {
  position: absolute;
  width: 84%;
  height: 92%;
  left: 8%;
  top: 4%;
  border-radius: 3px;
  opacity: 0;
  transform: translateY(0) rotate(0deg);
  transform-origin: top center;
  transition:
    transform 0.7s cubic-bezier(0.32, 0.72, 0.4, 1),
    opacity 0.4s ease;
}
.folder-paper.p1 { background: linear-gradient(135deg, #2b3a55, #5d7693); z-index: 2; }
.folder-paper.p2 { background: linear-gradient(135deg, #6f5440, #c0916e); z-index: 3; }
.folder-paper.p3 { background: linear-gradient(135deg, #d8c8a0, #c89884); z-index: 4; }

/* Front face — covers everything at rest. Hinges at TOP edge, swings backward+up on hover,
   exposing the interior so the papers can droop out the bottom. */
.folder-front {
  position: absolute;
  inset: 0;
  background: var(--fg);
  border-radius: 3% 3% 5% 5%;
  z-index: 5;
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.55s cubic-bezier(0.45, 0.1, 0.3, 1);
  backface-visibility: hidden;
}

/* Hover: front folds backward (out of viewer's path), papers slide down + tilt slightly (耷拉) */
.has-anim .pin-anchor:hover .folder-front,
.has-anim .zuopin-link:focus-visible .folder-front {
  transform: rotateX(-128deg);
}
.has-anim .pin-anchor:hover .folder-paper,
.has-anim .zuopin-link:focus-visible .folder-paper {
  opacity: 1;
}
.has-anim .pin-anchor:hover .folder-paper.p1,
.has-anim .zuopin-link:focus-visible .folder-paper.p1 {
  transform: translateY(45%) rotate(-2.5deg);
  transition-delay: 0.18s;
}
.has-anim .pin-anchor:hover .folder-paper.p2,
.has-anim .zuopin-link:focus-visible .folder-paper.p2 {
  transform: translateY(78%) rotate(2deg);
  transition-delay: 0.28s;
}
.has-anim .pin-anchor:hover .folder-paper.p3,
.has-anim .zuopin-link:focus-visible .folder-paper.p3 {
  transform: translateY(110%) rotate(-1deg);
  transition-delay: 0.38s;
}

.zuopin-hint {
  margin-top: 2.5rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Breadcrumb (used on /work/inside/) */
.breadcrumb {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.breadcrumb a { border-bottom: 1px solid var(--muted); padding-bottom: 1px; }
.breadcrumb a:hover { text-decoration: none; color: var(--fg); border-color: var(--fg); }

/* Mobile */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .site-nav { padding: 1.25rem 5vw; }
  .nav-links { gap: 1.25rem; font-size: 0.9rem; }
  .hero { padding: 3.5rem 5vw 2rem; }
  section { padding: 2.25rem 5vw; }
  .site-footer { margin-top: 3.5rem; padding: 3rem 5vw 2rem; }
  .site-footer.big { margin-top: 3.5rem; padding-top: 3rem; }
  .footer-meta { gap: 1rem; }
  .floats { display: none; } /* keep mobile clean */
}
