/* 常在 Still Studio — a white sheet ruled with hairlines; the lavender top stone of the logo rides the live line. */

/* Chiron GoRound TC 300 (OFL), subset to the ~5,600 most common Traditional Chinese characters + ASCII */
@font-face {
  font-family: "Chiron GoRound TC";
  src: url("../fonts/chiron-gr-tc-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
/* Chiron GoRound TC 700 (OFL), same subset: used for emphasis and product names */
@font-face {
  font-family: "Chiron GoRound TC";
  src: url("../fonts/chiron-gr-tc-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* jf open 粉圓 2.0 (OFL): the brand logo face, subset to the lockup characters only */
@font-face {
  font-family: "jf-openhuninn";
  src: url("../fonts/jf-openhuninn-logo.woff2") format("woff2");
  font-display: swap;
}
/* Jost (OFL), latin subset */
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  /* brand palette (常在 STILL STUDIO 標誌規範): 夜墨 / 石墨 / 灰石 / 淡紫 */
  --paper: #f5f8f8;
  --ink: #0f1f1e;
  --ink-soft: #33474b;
  --stone: #6a7b7a;
  --line: #d3dcdb;
  --accent: #b8a4ff;
  --accent-ink: #5a46c8;

  --gutter: 1.5rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-zh: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Heiti TC", sans-serif;
  --font-display: "Chiron GoRound TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --font-en: "Jost", "Century Gothic", "Avenir Next", sans-serif;
}

@media (min-width: 52rem) {
  :root {
    --gutter: 5vw;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  scrollbar-color: var(--line) var(--paper);
  scrollbar-width: thin;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-zh);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: 0.03em;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
  box-shadow: 0 0 0 6px var(--accent);
}

a {
  color: inherit;
}

h1, h2, h3, p {
  margin: 0;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the wordmark writes itself: hairline outlines draw stroke by stroke, then fill,
   then the lavender top stone of the logo lights above 在 */
.wordmark__svg {
  display: block;
  height: clamp(6.25rem, 18vw, 12.75rem);
  width: auto;
  max-width: 100%;
  overflow: visible;
}
.stroke {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.lamp {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  .stroke {
    animation:
      write 3.2s cubic-bezier(0.45, 0, 0.25, 1) both,
      ink-in 1.3s var(--ease) both;
  }
  .stroke--1 {
    animation-delay: 0.3s, 3.1s;
  }
  .stroke--2 {
    animation-delay: 1.2s, 3.6s;
  }
  .lamp {
    animation:
      lamp-on 1.8s var(--ease) 4.4s both,
      lamp-breathe 7s ease-in-out 6.2s infinite;
  }
}
@keyframes write {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes ink-in {
  from {
    fill-opacity: 0;
  }
  to {
    fill-opacity: 1;
  }
}
@keyframes lamp-on {
  from {
    opacity: 0;
    transform: translateY(-40%) scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes lamp-breathe {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* CJK phrases wrap as units; .em is the heavy phrase of a light/heavy pair */
.ph {
  display: inline-block;
}
.em {
  font-weight: 700;
}
.em--line {
  display: block;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus {
  top: 1rem;
}

/* ───────── hairlines ───────── */

/* every rule is a pseudo-element hanging off the live line on the left; each draws in when it scrolls into view */
.hero__foot::before,
.works::before,
.work::before,
.products::after,
.base::before {
  content: "";
  position: absolute;
  left: calc(var(--gutter) / 2);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
  transform-origin: left;
  transition: transform 1.5s var(--ease) var(--d, 0s);
}
.js .draw:not(.in)::before,
.js .draw:not(.in)::after {
  transform: scaleX(0);
}

/* the live line down the left margin, with one small marker riding it */
.rail {
  --p: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: calc(var(--gutter) / 2);
  width: 1px;
  background: var(--line);
  pointer-events: none;
}
.rail::after {
  content: "";
  position: absolute;
  left: -6.5px;
  top: calc(var(--p) * (100% - 8px));
  width: 14px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.page {
  position: relative;
}

/* ───────── hero ───────── */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(100svh, 60rem);
  padding: 0 var(--gutter) 2rem;
}
.hero__foot {
  position: relative;
}
.hero__foot::before {
  top: 0;
  left: calc(var(--gutter) / -2);
  right: 0;
  --d: 0.6s;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 0;
}
.bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.mark {
  width: 3rem;
  height: 3rem;
  flex: none;
}
.lockup {
  display: grid;
  gap: 0.15rem;
  font-family: "jf-openhuninn", var(--font-display);
  line-height: 1;
}
.lockup__zh {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.lockup__en {
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  color: var(--stone);
}
.bar nav {
  display: flex;
  gap: 2rem;
}
.bar nav a {
  padding: 0.3rem 0;
  font-size: 0.95rem;
  text-decoration: none;
  background: linear-gradient(var(--accent-ink), var(--accent-ink)) left bottom / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.bar nav a:hover,
.bar nav a:focus-visible {
  background-size: 100% 1px;
}

.hero__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
  padding: 3rem 0 4rem;
}

.wordmark {
  line-height: 0;
}

.tagline {
  max-width: 12em;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1.35;
  letter-spacing: 0.06em;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 2.25rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-size: 1.05rem;
  text-decoration: none;
  transition: gap 0.5s var(--ease), color 0.3s var(--ease);
}
.cta:hover {
  gap: 1.2em;
  color: var(--accent-ink);
}
.cta svg,
.go svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.latin {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-en);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.latin span {
  color: var(--ink-soft);
  letter-spacing: 0.16em;
  text-transform: none;
}

/* ───────── intro ───────── */

.about {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem 2rem;
  padding: 6rem var(--gutter);
}
.about h2 {
  grid-column: 1 / -1;
  max-width: 14em;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.4;
  letter-spacing: 0.06em;
}
.about__body {
  grid-column: 1 / -1;
  display: grid;
  gap: 1.4rem;
  max-width: 34em;
}
.about__body p {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ink);
}
.about__body .about__close {
  color: var(--ink);
  font-weight: 500;
}

@media (min-width: 52rem) {
  .about {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    padding-block: 8rem;
  }
  .about h2 {
    grid-column: 1 / 9;
  }
  .about__body {
    grid-column: 6 / 12;
  }
}

/* ───────── products: ruled rows ───────── */

.works {
  position: relative;
  padding: 5rem var(--gutter) 6rem;
}
.works::before {
  top: 0;
}
.works__title {
  margin-bottom: 3rem;
  font-size: clamp(2rem, 3.6vw, 3rem);
  letter-spacing: 0.1em;
}

.products {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.products::after {
  bottom: 0;
  left: calc(var(--gutter) / -2);
  right: 0;
}

.work {
  position: relative;
}
.work::before {
  top: 0;
  left: calc(var(--gutter) / -2);
  right: 0;
}
.work::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--gutter) / -2);
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease);
}
.work:has(a:hover)::after,
.work:has(a:focus-visible)::after {
  transform: scaleX(1);
}

.work > a {
  display: grid;
  gap: 0.75rem 2rem;
  padding: 2.25rem 0;
  text-decoration: none;
  transition: opacity 0.5s var(--ease);
}
.products:has(a:hover) .work:not(:hover) > a,
.products:has(a:focus-visible) .work:not(:focus-within) > a {
  opacity: 0.5;
}

.work__logo {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
}
.work__logo--empty {
  display: none;
}

.work__name {
  font-weight: 700;
  font-size: clamp(1.5rem, 2vw, 1.8rem);
  line-height: 1.3;
  letter-spacing: 0.08em;
  transition: translate 0.6s var(--ease), color 0.4s var(--ease);
}
.work > a:hover .work__name,
.work > a:focus-visible .work__name {
  translate: 0.6rem 0;
  color: var(--accent-ink);
}
.work__role {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.work__blurb {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  line-height: 1.7;
  text-wrap: balance;
}
.go {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: color 0.4s var(--ease);
}
.work > a:hover .go,
.work > a:focus-visible .go {
  color: var(--accent-ink);
}

.work--open {
  padding: 2.25rem 0;
}
.work--open p {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

@media (min-width: 52rem) {
  .work > a {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
    padding: 2.5rem 0;
  }
  .work__logo {
    grid-column: 1 / 2;
    width: 3.5rem;
    height: 3.5rem;
  }
  .work__logo--empty {
    display: block;
  }
  .work__name {
    grid-column: 2 / 6;
  }
  .work__text {
    grid-column: 6 / 12;
  }
  .go {
    grid-column: 12 / 13;
    justify-self: end;
  }
  .work--open {
    padding: 2.75rem 0;
  }
}

/* ───────── contact ───────── */

.contact {
  position: relative;
  padding: 6rem var(--gutter) 7rem;
}
.contact h2 {
  max-width: 20em;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.5;
  letter-spacing: 0.06em;
}
.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.5rem;
}
.mail {
  font-family: var(--font-en);
  font-size: clamp(1.5rem, 3.6vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.4s var(--ease), color 0.4s var(--ease);
}
.mail:hover {
  color: var(--accent-ink);
  text-decoration-color: var(--accent);
}
.copy {
  padding: 0.3rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink-soft);
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.copy:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

.base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.75rem var(--gutter) 2rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.base::before {
  top: 0;
}
.base__sign {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.mark--small {
  width: 1.5rem;
  height: 1.5rem;
}
.base__domain {
  font-family: var(--font-en);
  letter-spacing: 0.14em;
}

/* ───────── small screens ───────── */

@media (max-width: 52rem) {
  .lockup__en {
    display: none;
  }
  .bar nav {
    gap: 1.25rem;
  }
  .hero {
    min-height: 0;
  }
  .hero__main {
    padding-block: 4rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
