/* =========================================================
   Alan Wang — Independent Designer
   Editorial / Swiss-inspired. Paper + ink + vermilion.
   ========================================================= */

:root {
  --paper:    #f3f1ec;
  --paper-2:  #ebe8e1;
  --card:     #faf9f6;
  --ink:      #12110f;
  --ink-2:    #34312c;
  --muted:    #6e685e;
  --faint:    #9d968a;
  --line:     rgba(18,17,15,.14);
  --line-2:   rgba(18,17,15,.07);
  --accent:   #ff4a17;
  --accent-2: #12110f;

  --f-display: "Instrument Serif", "Songti SC", "Noto Serif SC", "Source Han Serif SC",
               "SimSun", "STSong", Georgia, "Times New Roman", serif;
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --shell: 1320px;
  --pad: 40px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="dark"] {
  --paper:    #0e0d0c;
  --paper-2:  #141210;
  --card:     #171513;
  --ink:      #f2efe8;
  --ink-2:    #ded9cf;
  --muted:    #9b948a;
  --faint:    #6d675e;
  --line:     rgba(242,239,232,.17);
  --line-2:   rgba(242,239,232,.08);
  --accent:   #ff5b2e;
  --accent-2: #f2efe8;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* film grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}
[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .16; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1,h2,h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
em { font-style: italic; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--pad); }

/* ============ TOP BAR ============ */
.top {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.top.stuck { border-bottom-color: var(--line); }

.top-in { display: flex; align-items: center; gap: 24px; height: 74px; }

.mark {
  font-family: var(--f-mono);
  font-size: 15px; font-weight: 500; letter-spacing: .16em;
  white-space: nowrap;
}
.mark .reg { font-size: 9px; vertical-align: super; color: var(--accent); margin-left: 1px; }

.top-nav { display: flex; gap: 26px; margin-left: auto; }
.top-nav a {
  position: relative; font-size: 13.5px; color: var(--muted);
  padding: 4px 0; transition: color .25s;
}
.top-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--ink); transition: width .3s var(--ease);
}
.top-nav a:hover { color: var(--ink); }
.top-nav a:hover::after { width: 100%; }

.top-r { display: flex; align-items: center; gap: 14px; }

.avail {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em;
  color: var(--muted); white-space: nowrap;
}
.avail i {
  width: 6px; height: 6px; border-radius: 50%; background: #2fbf5e;
  animation: blip 2.4s infinite;
}
@keyframes blip {
  0%,100% { box-shadow: 0 0 0 0 rgba(47,191,94,.5); }
  60%     { box-shadow: 0 0 0 7px rgba(47,191,94,0); }
}

.tgl {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font-size: 13px; color: var(--ink-2);
  transition: border-color .25s, transform .25s, color .25s;
}
.tgl:hover { border-color: var(--ink); transform: rotate(180deg); color: var(--accent); }

.burger { display: none; width: 32px; height: 32px; flex-direction: column; gap: 6px; align-items: center; justify-content: center; }
.burger i { display: block; width: 20px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid var(--line);
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.btn-solid { background: var(--accent-2); color: var(--paper); border-color: var(--accent-2); }
[data-theme="dark"] .btn-solid { color: #0e0d0c; }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-line:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); }

/* ============ HERO ============ */
.hero { padding: 64px 0 0; }

.hero-top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.kicker {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.kicker.right { text-align: right; }

.statement {
  font-family: var(--f-display);
  font-size: clamp(46px, 12.4vw, 178px);
  line-height: .94;
  letter-spacing: -.025em;
  padding: clamp(40px, 7vw, 84px) 0 clamp(32px, 5vw, 60px);
  font-weight: 400;
}
.statement .ln { display: block; overflow: hidden; }
.statement .ln > span {
  display: block;
  transform: translateY(105%);
  animation: rise 1.05s var(--ease) forwards;
}
.statement .ln:nth-child(2) > span { animation-delay: .09s; }
.statement .ln:nth-child(3) > span { animation-delay: .18s; }
@keyframes rise { to { transform: translateY(0); } }

.statement em { color: var(--accent); font-style: italic; }
.statement .dot { color: var(--accent); }
.statement .ln:nth-child(2) { padding-left: clamp(24px, 8vw, 140px); }
.statement .ln:nth-child(3) { padding-left: clamp(48px, 16vw, 300px); }

.hero-bot {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 40px; align-items: end;
  padding-top: 34px; border-top: 1px solid var(--line);
}
.hero-lede { max-width: 46ch; color: var(--muted); font-size: 16.5px; line-height: 1.75; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* ticker */
.ticker {
  margin-top: clamp(48px, 7vw, 84px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex; align-items: center; gap: 28px; width: max-content;
  animation: slide 34s linear infinite;
  font-family: var(--f-display); font-size: 30px; letter-spacing: -.01em; white-space: nowrap;
}
.ticker-track b { color: var(--accent); font-size: 16px; font-weight: 400; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ============ SECTIONS ============ */
.sec { padding: clamp(72px, 10vw, 140px) 0; }
.sec-alt { background: var(--paper-2); }

.sec-head {
  display: grid; grid-template-columns: 96px 1fr auto;
  align-items: baseline; gap: 20px;
  padding-bottom: 26px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.sec-idx { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--accent); }
.sec-title { font-family: var(--f-display); font-size: clamp(30px, 4.6vw, 56px); letter-spacing: -.02em; }
.sec-note { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--faint); text-align: right; }

/* ============ WORK LIST ============ */
.work { position: relative; }

.row {
  position: relative;
  z-index: 0;
  display: grid; grid-template-columns: 96px 1fr 320px 84px 40px;
  align-items: center; gap: 20px;
  padding: 30px 0; border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: padding-left .45s var(--ease);
}
.row::before {
  content: ""; position: absolute; inset: 0 -20px; border-radius: 4px;
  background: var(--card); opacity: 0; transition: opacity .35s; z-index: -1;
}
.row:hover { padding-left: 18px; }
.row:hover::before { opacity: 1; }

.r-idx { font-family: var(--f-mono); font-size: 12px; color: var(--faint); transition: color .3s; }
.row:hover .r-idx { color: var(--accent); }

.r-title {
  font-family: var(--f-display); font-size: clamp(24px, 3.4vw, 44px);
  letter-spacing: -.02em; line-height: 1.1;
  transition: color .3s;
}
.r-tags { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.r-year { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); text-align: right; }
.r-go { font-size: 17px; color: var(--faint); text-align: right; transition: transform .35s var(--ease), color .3s; }
.row:hover .r-go { color: var(--accent); transform: translate(3px,-3px); }

/* floating preview */
.preview {
  position: fixed; top: 0; left: 0; z-index: 55;
  width: 340px; aspect-ratio: 4 / 3;
  pointer-events: none; opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(18,17,15,.42);
  background: var(--card);
  will-change: transform;
}
.preview.on { opacity: 1; }
.preview img { width: 100%; height: 100%; object-fit: cover; }

/* ============ SERVICES ============ */
.svc { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; margin-top: 30px; }
.svc-item {
  padding: 32px 28px 32px 0;
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 12px;
}
.svc-item:last-child { border-right: 0; }
.svc-item:not(:first-child) { padding-left: 28px; }
.svc-n { font-family: var(--f-mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.svc-item h3 { font-family: var(--f-display); font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.02em; }
.svc-item > p { color: var(--muted); font-size: 15px; line-height: 1.7; }
.svc-item ul { margin-top: 6px; display: grid; gap: 7px; }
.svc-item ul li {
  font-size: 13px; color: var(--ink-2);
  padding-left: 16px; position: relative;
}
.svc-item ul li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }

/* ============ FLOW ============ */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; }
.flow li {
  padding: 34px 26px 10px 0;
  border-top: 2px solid var(--ink);
  margin-right: 26px;
  display: flex; flex-direction: column; gap: 10px;
}
.flow li:last-child { margin-right: 0; }
.flow .f-n { font-family: var(--f-mono); font-size: 12px; color: var(--faint); }
.flow h3 { font-family: var(--f-display); font-size: 27px; letter-spacing: -.015em; }
.flow p { color: var(--muted); font-size: 14.5px; }

/* ============ ABOUT ============ */
.about { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 6vw, 90px); align-items: start; }

.art-box {
  position: relative; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden;
  background: linear-gradient(150deg, var(--ink) 0%, #2b2723 55%, var(--accent) 190%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 28px;
  box-shadow: 0 40px 70px -40px rgba(18,17,15,.5);
}
.art-box::after {
  content: ""; position: absolute; right: -70px; bottom: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
}
.art-mark { font-family: var(--f-mono); font-size: 13px; letter-spacing: .22em; color: rgba(255,255,255,.85); }
.art-sub { font-family: var(--f-display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; color: #fff; letter-spacing: -.015em; }

.about-txt .sec-idx { display: block; margin-bottom: 10px; }
.about-h { font-family: var(--f-display); font-size: clamp(32px, 4.6vw, 58px); letter-spacing: -.02em; margin-bottom: 22px; }
.about-txt p { color: var(--muted); margin-bottom: 14px; max-width: 58ch; }
.about-txt .lead {
  font-family: var(--f-display); font-size: clamp(19px, 2vw, 25px); line-height: 1.5;
  color: var(--ink); letter-spacing: -.01em; margin-bottom: 18px;
}

.facts {
  display: flex; flex-wrap: wrap; gap: 42px; margin: 34px 0 30px;
  padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.facts dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; margin-bottom: 6px; }
.facts dd { font-family: var(--f-display); font-size: 34px; letter-spacing: -.02em; }

.clients { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.clients li {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  transition: color .25s, border-color .25s, background .25s;
}
.clients li:hover { color: var(--paper); background: var(--ink); border-color: var(--ink); }

/* ============ QUOTE ============ */
.quote { text-align: center; max-width: 900px; margin: 0 auto; }
.quote p {
  font-family: var(--f-display);
  font-size: clamp(26px, 4.4vw, 56px);
  line-height: 1.22; letter-spacing: -.02em;
}
.quote footer {
  margin-top: 26px; font-family: var(--f-mono); font-size: 11.5px;
  letter-spacing: .1em; color: var(--faint);
}

/* ============ CONTACT ============ */
.contact { border-top: 1px solid var(--line); }
.contact .sec-idx { display: block; margin-bottom: 18px; }
.contact-h {
  font-family: var(--f-display);
  font-size: clamp(44px, 9.5vw, 132px);
  line-height: .98; letter-spacing: -.03em; margin-bottom: 26px;
}
.contact-h em { color: var(--accent); }
.contact-lede { color: var(--muted); max-width: 46ch; margin-bottom: 38px; }

.mail-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.mail {
  font-family: var(--f-display);
  font-size: clamp(22px, 4vw, 46px); letter-spacing: -.02em;
  border-bottom: 2px solid transparent; transition: border-color .3s, color .3s;
  word-break: break-all;
}
.mail:hover { color: var(--accent); border-bottom-color: var(--accent); }
.copy {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  transition: background .25s, color .25s, border-color .25s;
}
.copy:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.links { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 30px; }
.links a { font-size: 14px; color: var(--muted); transition: color .25s; }
.links a:hover { color: var(--accent); }

/* ============ FOOTER ============ */
.foot { border-top: 1px solid var(--line); padding: 26px 0; }
.foot-in {
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .09em; color: var(--faint);
}
.foot-mid b { color: var(--ink-2); font-weight: 500; }

/* ============ REVEAL ============ */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .hero-bot { grid-template-columns: 1fr; }
  .hero-cta { justify-content: flex-start; }
  .about { grid-template-columns: 1fr; }
  .art-box { aspect-ratio: 16 / 9; max-width: 520px; }
  .row { grid-template-columns: 60px 1fr 90px 40px; }
  .r-tags { display: none; }
}

@media (max-width: 820px) {
  :root { --pad: 22px; }

  .top-nav {
    position: fixed; inset: 74px 0 auto; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 20px; margin: 0;
    transform: translateY(-120%); transition: transform .45s var(--ease);
  }
  .top-nav.open { transform: none; }
  .top-nav a { font-size: 19px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
  .top-nav a::after { display: none; }
  .burger { display: flex; }
  .burger.on i:first-child { transform: translateY(3.75px) rotate(45deg); }
  .burger.on i:last-child  { transform: translateY(-3.75px) rotate(-45deg); }
  .avail { display: none; }

  .hero-top { flex-direction: column; gap: 8px; align-items: flex-start; }
  .kicker.right { text-align: left; }
  .statement .ln:nth-child(2) { padding-left: 6vw; }
  .statement .ln:nth-child(3) { padding-left: 12vw; }

  .sec-head { grid-template-columns: 1fr; gap: 6px; }
  .sec-note { text-align: left; }

  .row { grid-template-columns: 44px 1fr 22px; gap: 12px; padding: 22px 0; }
  .r-year { display: none; }
  .preview { display: none; }

  .svc-item { border-right: 0; border-bottom: 1px solid var(--line-2); padding: 26px 0; }
  .svc-item:not(:first-child) { padding-left: 0; }

  .flow li { border-top-width: 1px; margin-right: 0; padding: 22px 0; border-bottom: 1px solid var(--line-2); }

  .facts { gap: 28px; }
  .facts dd { font-size: 27px; }

  .foot-in { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .statement .ln > span { transform: none; }
  .rv { opacity: 1; transform: none; }
}
