@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Syne:wght@500;600;700;800&display=swap");

:root {
  --bg: #f2f0eb;
  --ink: #111;
  --muted: #666;
  --line: #111;
  --accent: #ff4d00;
  --sidebar: 80px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "IBM Plex Mono", "Noto Sans TC", monospace;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* ── Fixed sidebar ── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 10px;
  border-right: 2px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}

.sidebar-back,
.sidebar .yuwai-back {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
  max-height: 42vh;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .yuwai-back:hover {
  color: var(--accent);
}

.sidebar-mark {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex: 1;
  justify-content: center;
  padding: 12px 0;
}

.sidebar-nav a {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--accent);
  font-weight: 500;
}

.sidebar-cta {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 10px 8px;
  background: var(--ink);
  color: var(--bg);
  line-height: 1.2;
  flex-shrink: 0;
}

/* ── Main offset ── */
.page {
  margin-left: var(--sidebar);
}

/* ── Hero: full bleed + overlapping type ── */
.hero-full {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-full img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
}

.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(242, 240, 235, 0.92) 88%);
}

.hero-type {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(24px, 5vw, 64px);
}

.hero-type h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(3.2rem, 11vw, 9rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.hero-type h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}

.hero-type h1 em {
  font-style: normal;
  color: var(--accent);
  -webkit-text-stroke: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  max-width: 720px;
  font-size: 0.78rem;
}

.hero-meta strong {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── Marquee services ── */
.marquee-wrap {
  overflow: hidden;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  color: var(--bg);
  padding: 14px 0;
}

.marquee-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-family: "Syne", sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.marquee-track span {
  opacity: 0.35;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── Services: brutal list ── */
.services-brutal {
  padding: clamp(48px, 8vw, 96px) clamp(24px, 5vw, 64px);
}

.services-brutal header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 48px;
}

.services-brutal h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.services-brutal header p {
  max-width: 280px;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

.service-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 32px 0;
  border-top: 2px solid var(--line);
}

.service-row:last-child {
  border-bottom: 2px solid var(--line);
}

.service-row .num {
  font-family: "Syne", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.service-row h3 {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.service-row p {
  margin: 0;
  max-width: 520px;
  font-size: 0.82rem;
  color: var(--muted);
}

.service-row .tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 2px solid var(--line);
  white-space: nowrap;
}

/* ── Horizontal portfolio rail ── */
.works-rail-section {
  padding: clamp(48px, 8vw, 80px) 0 clamp(48px, 8vw, 80px) clamp(24px, 5vw, 64px);
  overflow: hidden;
}

.works-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-right: clamp(24px, 5vw, 64px);
  margin-bottom: 32px;
}

.works-rail-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  text-transform: uppercase;
}

.works-rail-head span {
  font-size: 0.72rem;
  color: var(--muted);
}

.works-rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  scrollbar-width: thin;
}

.works-rail::-webkit-scrollbar {
  height: 4px;
}

.works-rail::-webkit-scrollbar-thumb {
  background: var(--ink);
}

.work-slide {
  flex: 0 0 clamp(280px, 42vw, 480px);
  scroll-snap-align: start;
  border: 2px solid var(--line);
  background: var(--bg);
}

.work-slide figure {
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.work-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 400ms ease;
}

.work-slide:hover img {
  filter: grayscale(0%);
}

.work-slide figcaption {
  padding: 16px 18px;
  border-top: 2px solid var(--line);
}

.work-slide strong {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.work-slide span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── About: asymmetric ── */
.about-asym {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 70vh;
}

.about-copy {
  padding: clamp(48px, 8vw, 96px) clamp(24px, 5vw, 64px);
  border-top: 2px solid var(--line);
  border-right: 2px solid var(--line);
}

.about-copy h2 {
  margin: 12px 0 24px;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
}

.about-copy p {
  max-width: 480px;
  font-size: 0.82rem;
  color: var(--muted);
}

.about-visual {
  position: relative;
  border-top: 2px solid var(--line);
  overflow: hidden;
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
}

.about-stamp {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 120px;
  height: 120px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  transform: rotate(-12deg);
  font-weight: 500;
}

/* ── Contact bar ── */
.contact-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 64px);
  background: var(--ink);
  color: var(--bg);
}

.contact-bar h2 {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;
}

.contact-bar p {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.65;
}

.contact-bar a.email {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  padding: 24px clamp(24px, 5vw, 64px);
  border-top: 2px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
}

.page-footer {
  margin-left: var(--sidebar);
  padding: 16px clamp(24px, 5vw, 64px);
  font-size: 0.68rem;
  color: var(--muted);
  border-top: 2px solid var(--line);
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }

  .sidebar {
    position: sticky;
    inset: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .sidebar-back,
  .sidebar .yuwai-back,
  .sidebar-nav a,
  .sidebar-cta {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    transform: none;
    max-height: none;
    overflow: visible;
    white-space: normal;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 12px;
    flex: 0;
    padding: 0;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .service-row .tag {
    justify-self: start;
  }

  .about-asym {
    grid-template-columns: 1fr;
  }

  .about-visual {
    min-height: 320px;
  }

  .contact-bar {
    grid-template-columns: 1fr;
  }

  .page-footer {
    margin-left: 0;
  }
}
