*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --color-bg: #F5F6F7;
  --color-text: #1a1a1a;
  --color-muted: #555552;
  --color-link: #1a1a1a;
  --color-link-hover: #333;
  --color-divider: rgba(0,0,0,0.08);
  --color-accent: #3876A8;
  --font: 'DM Sans', sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
[data-theme="dark"] {
  --color-bg: #111110;
  --color-text: #f0ede8;
  --color-muted: #999994;
  --color-link: #f0ede8;
  --color-link-hover: #ccc;
  --color-divider: rgba(255,255,255,0.08);
  --color-accent: #3876A8;
}
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

/* ── Header ── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 20px 120px;
  z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(245, 246, 247, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  opacity: 0; transform: translateY(-8px);
  animation: fadeUp 0.7s var(--ease-out) 0.1s forwards;
  transition: background 0.3s ease;
}
[data-theme="dark"] .header { background: rgba(17,17,16,0.7); }
.header.scrolled { background: rgba(245, 246, 247, 0.92); }
[data-theme="dark"] .header.scrolled { background: rgba(17,17,16,0.92); }

.header__brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header__text { display: flex; flex-direction: column; line-height: 1.25; }
.header__name { font-weight: 500; font-size: 13px; letter-spacing: 0.08em; color: var(--color-text); }
.header__subtitle { font-weight: 300; font-size: 11px; color: var(--color-muted); letter-spacing: 0.04em; }

/* nav links */
.header__nav { display: flex; align-items: center; gap: 28px; }
.header__nav-link {
  font-size: 12px; font-weight: 400; letter-spacing: 0.04em;
  color: var(--color-muted); text-decoration: none;
  position: relative;
  transition: color 0.2s;
}
.header__nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--color-accent);
  transition: width 0.35s var(--ease-out);
}
.header__nav-link:hover::after { width: 100%; }
.header__nav-link:hover { color: var(--color-text); }

.header__controls { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }

.header__theme {
  background: none; border: none; cursor: pointer;
  color: var(--color-muted); padding: 4px;
  display: flex; align-items: center;
  transition: color 0.2s;
}
.header__theme:hover { color: var(--color-text); }

.header__cta {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--color-link); text-decoration: none;
  font-weight: 400; font-size: 13px;
  letter-spacing: 0.02em; position: relative;
  transition: gap 0.3s var(--ease-out), color 0.2s;
}
.header__cta::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--color-accent);
  transition: width 0.35s var(--ease-out);
}
.header__cta:hover::after { width: 100%; }
.header__cta:hover { gap: 14px; color: var(--color-link-hover); }
.header__cta:hover .header__arrow { transform: translateX(4px); }
.header__arrow { width: 16px; height: 16px; stroke-width: 1.5; transition: transform 0.3s var(--ease-out); }

/* ── Hero ── */
.hero {
  display: flex; align-items: center;
  justify-content: center; padding: 0 120px; text-align: center;
  min-height: 100vh;
}
.hero__content { max-width: 860px; }
.hero__headline {
  font-family: var(--font);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.22;
  letter-spacing: -0.04em;
  font-weight: 300;
  opacity: 0; transform: translateY(20px);
  will-change: opacity, transform;
}
.hero__headline.visible { animation: fadeUp 0.9s var(--ease-out) forwards; }
.hero__line { display: inline; }
.hero__line--muted { color: var(--color-muted); }
.hero__line--bold { color: var(--color-text); font-weight: 400; }

/* ── Section ── */
.section { padding: 0 120px 48px; }
.section__header {
  padding: 32px 0 0;
  border-top: 1px solid var(--color-divider);
  margin-bottom: 0;
}
.section__label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-muted);
}

/* ── Process accordions ── */
.process-grid {
  display: flex;
  flex-direction: column;
  padding: 24px 0 8px;
}
.process-card {
  border-top: 1px solid var(--color-divider);
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.process-card:last-child { border-bottom: 1px solid var(--color-divider); }
.process-card.visible { opacity: 1; transform: translateY(0); }
.process-card__trigger {
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: 0 24px;
  padding: 20px 0;
  cursor: pointer;
  background: none; border: none;
  width: 100%; text-align: left;
  font-family: var(--font);
}
.process-card__num {
  font-size: 10px; font-weight: 300; letter-spacing: 0.08em;
  color: var(--color-muted);
}
.process-card__name {
  font-size: 0.95rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--color-text); line-height: 1.3;
}
.process-card__icon {
  width: 14px; height: 14px;
  color: var(--color-muted);
  transition: transform 0.35s var(--ease-out), color 0.2s;
  flex-shrink: 0;
}
.process-card.open .process-card__icon { transform: rotate(45deg); color: var(--color-text); }
.process-card__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out);
}
.process-card.open .process-card__body { grid-template-rows: 1fr; }
.process-card__inner { overflow: hidden; }
.process-card__desc {
  padding: 0 0 20px 64px;
  font-size: 13.5px; font-weight: 300; color: var(--color-muted);
  line-height: 1.7; max-width: 520px;
}

/* ── Row — shared grid pattern ── */
.row {
  display: grid;
  grid-template-columns: 2fr 5fr;
  gap: 0 60px;
  padding: 20px 0;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.row.visible { opacity: 1; transform: translateY(0); }

.row__key {
  font-size: 11px; color: var(--color-muted); font-weight: 300;
  letter-spacing: 0.04em; padding-top: 4px; line-height: 1.6;
}
.row__name {
  font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em;
  color: var(--color-text); margin-bottom: 10px; line-height: 1.25;
}
.row__desc {
  font-size: 13.5px; font-weight: 300; color: var(--color-muted);
  line-height: 1.7; max-width: 520px;
}
.row__desc + .row__desc { margin-top: 14px; }

/* ── Status ── */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 300; color: var(--color-muted);
  letter-spacing: 0.02em;
}
.status__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent);
  flex-shrink: 0; animation: blink 2.4s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Inline links ── */
.inline-links { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.inline-link {
  font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--color-link); text-decoration: none; position: relative;
  transition: color 0.2s;
}
.inline-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--color-accent);
  transition: width 0.35s var(--ease-out);
}
.inline-link:hover::after { width: 100%; }
.inline-link:hover { color: var(--color-link-hover); }

/* ── Tags ── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 400; letter-spacing: 0.04em;
  color: var(--color-muted);
  border: 1px solid var(--color-divider);
  border-radius: 9999px;
  padding: 3px 10px;
  transition: color 0.2s, border-color 0.2s;
}

/* ── Projects marquee ── */
.marquee-wrap {
  overflow: hidden;
  margin: 32px -120px 0;
  padding: 18px 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0px,
    black 120px,
    black calc(100% - 120px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0px,
    black 120px,
    black calc(100% - 120px),
    transparent 100%
  );
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-content {
  white-space: nowrap;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding-right: 0;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Article row ── */
.article-row {
  display: grid;
  grid-template-columns: 2fr 5fr;
  gap: 0 60px;
  padding: 20px 0;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  cursor: pointer;
}
.article-row.visible { opacity: 1; transform: translateY(0); }
.article-row__meta { display: flex; flex-direction: column; gap: 4px; padding-top: 3px; }
.article-row__cat { font-size: 11px; color: var(--color-muted); font-weight: 300; letter-spacing: 0.04em; }
.article-row__date { font-size: 11px; color: var(--color-muted); font-weight: 300; letter-spacing: 0.04em; }
.article-row__read {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--color-link); text-decoration: none;
  font-weight: 400; font-size: 13px;
  letter-spacing: 0.02em; position: relative;
  transition: gap 0.3s var(--ease-out);
  margin-top: 14px;
}
.article-row__read::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--color-accent);
  transition: width 0.35s var(--ease-out);
}
.article-row:hover .article-row__read::after { width: 100%; }
.article-row:hover .article-row__read { gap: 14px; }
.article-row:hover .article-row__arrow { transform: translateX(4px); }
.article-row__arrow { width: 14px; height: 14px; stroke-width: 1.5; transition: transform 0.3s var(--ease-out); }

/* ── Contact ── */
.contact {
  padding: 56px 120px 48px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 20px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.contact.visible { opacity: 1; transform: translateY(0); }
.contact__label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-muted);
}
.contact__heading {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300; letter-spacing: -0.04em;
  line-height: 1.15; color: var(--color-text);
}
.contact__detail { font-size: 13px; font-weight: 300; color: var(--color-muted); }
.contact__detail a { color: var(--color-muted); text-decoration: none; transition: color 0.2s; }
.contact__detail a:hover { color: var(--color-text); }
.contact__cta {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--color-link); text-decoration: none;
  font-weight: 400; font-size: 15px;
  letter-spacing: -0.01em; position: relative;
  transition: gap 0.3s var(--ease-out), color 0.2s;
}
.contact__cta::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--color-accent);
  transition: width 0.35s var(--ease-out);
}
.contact__cta:hover::after { width: 100%; }
.contact__cta:hover { gap: 16px; }
.contact__cta:hover .contact__arrow { transform: translateX(4px); }
.contact__arrow { width: 18px; height: 18px; stroke-width: 1.5; transition: transform 0.3s var(--ease-out); }

/* ── Footer ── */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 120px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 1.2s forwards;
}
.footer__copy { font-size: 12px; color: var(--color-muted); font-weight: 300; letter-spacing: 0.04em; }
.footer__nav { display: flex; gap: 32px; }
.footer__link {
  font-size: 12px; font-weight: 400; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-text);
  text-decoration: none; position: relative; transition: color 0.2s;
}
.footer__link::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--color-accent);
  transition: width 0.3s var(--ease-out);
}
.footer__link:hover::after { width: 100%; }
.footer__link:hover { color: var(--color-link-hover); }

/* ── Article overlay ── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--color-bg); overflow-y: auto;
}
.overlay.active { display: block; }
.overlay__header {
  position: sticky; top: 0;
  background: rgba(245, 246, 247, 0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  padding: 16px 36px; display: flex;
  justify-content: space-between; align-items: center;
}
[data-theme="dark"] .overlay__header { background: rgba(17,17,16,0.88); }
.overlay__back {
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 400;
  color: var(--color-muted); letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.2s, gap 0.3s var(--ease-out);
}
.overlay__back:hover { color: var(--color-text); gap: 12px; }
.overlay__back svg { width: 14px; height: 14px; stroke-width: 1.5; transition: transform 0.3s var(--ease-out); flex-shrink: 0; }
.overlay__back:hover svg { transform: translateX(-4px); }
.overlay__meta { font-size: 11px; color: var(--color-muted); font-weight: 300; letter-spacing: 0.04em; }

.overlay__body { max-width: 640px; margin: 0 auto; padding: 64px 36px 120px; }
.overlay__tag {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-muted); margin-bottom: 16px;
}
.overlay__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 300;
  letter-spacing: -0.03em; line-height: 1.2; color: var(--color-text);
  margin-bottom: 52px;
}
.overlay__content h2 {
  font-size: 1rem; font-weight: 500; letter-spacing: 0em;
  color: var(--color-text); margin: 44px 0 12px;
}
.overlay__content h3 {
  font-size: 0.875rem; font-weight: 500;
  color: var(--color-text); margin: 0 0 6px;
}
.overlay__content p {
  font-size: 14px; font-weight: 300; color: var(--color-muted);
  line-height: 1.85; margin-bottom: 16px;
}
.overlay__content blockquote {
  border-left: 2px solid var(--color-divider);
  padding: 4px 0 4px 20px; margin: 28px 0;
}
.overlay__content blockquote p {
  font-style: italic; margin: 0; color: var(--color-muted);
}
.overlay__content ol {
  list-style: none; counter-reset: steps;
  display: flex; flex-direction: column;
  gap: 0; margin-bottom: 16px;
}
.overlay__content ol li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 16px;
  padding: 20px 0;
  align-items: start;
}
.overlay__content ol li::before {
  content: '0' counter(steps);
  font-size: 11px; color: var(--color-muted);
  font-weight: 300; letter-spacing: 0.06em; padding-top: 2px;
  grid-column: 1; grid-row: 1 / 3;
  align-self: start;
}
.overlay__content ol li h3 { grid-column: 2; grid-row: 1; margin: 0 0 5px; }
.overlay__content ol li p { grid-column: 2; grid-row: 2; margin: 0; font-size: 13.5px; }
.overlay__refs {
  margin-top: 44px; padding-top: 24px;
  border-top: 1px solid var(--color-divider);
}
.overlay__refs p {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 500; color: var(--color-muted); margin-bottom: 12px;
}
.overlay__refs a {
  font-size: 13px; color: var(--color-muted); text-decoration: none;
  display: block; margin-bottom: 8px; transition: color 0.2s; font-weight: 300;
}
.overlay__refs a:hover { color: var(--color-text); }

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ── Custom cursor ── */
* { cursor: none !important; }
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-accent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s var(--ease-out), height 0.2s var(--ease-out),
              background 0.2s, opacity 0.2s;
  will-change: transform;
}
.cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--color-accent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out),
              border-color 0.2s, background 0.2s, opacity 0.2s;
  will-change: transform;
  opacity: 0.5;
}
body.cursor-hover .cursor-dot {
  width: 10px; height: 10px;
  background: var(--color-accent);
}
body.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  opacity: 0.15;
  background: var(--color-accent);
  border-color: transparent;
}
body.cursor-clicking .cursor-dot { width: 4px; height: 4px; }
body.cursor-clicking .cursor-ring { width: 28px; height: 28px; opacity: 0.3; }
body.cursor-hidden .cursor-dot,
body.cursor-hidden .cursor-ring { opacity: 0; }

@media (max-width: 1100px) {
  .header { padding: 20px 48px; }
  .hero { padding: 0 48px; }
  .section { padding: 0 48px 48px; }
  .contact { padding: 56px 48px 48px; }
  .footer { padding: 24px 48px; }
  .marquee-wrap { margin-left: -48px; margin-right: -48px; }
}
@media (max-width: 840px) {
  .header__nav { display: none; }
}
@media (max-width: 700px) {
  .header { padding: 16px 24px; }
  .hero { padding: 0 24px; }
  .section { padding: 0 24px 48px; }
  .row, .article-row { grid-template-columns: 1fr; gap: 10px; }
  .contact { padding: 48px 24px; }
  .footer { padding: 20px 24px; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
  .overlay__body { padding: 40px 24px 80px; }
  .overlay__header { padding: 14px 24px; }
  .overlay__content ol li { grid-template-columns: 32px 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .marquee-wrap { margin-left: -24px; margin-right: -24px; }
  .header__theme { padding: 8px; min-width: 36px; min-height: 36px; justify-content: center; }
  .header__cta { font-size: 12px; }
  .header__controls { gap: 12px; }
}

/* ── Hide custom cursor on touch devices ── */
@media (hover: none) and (pointer: coarse) {
  * { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
  .polaroid { pointer-events: none; }
}

/* ── Polaroid hover gallery ── */
.polaroid {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  width: 160px;
  background: #fff;
  padding: 10px 10px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  transform-origin: center center;
  opacity: 0;
  will-change: transform, opacity;
  transition: box-shadow 0.2s;
}
.polaroid__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.polaroid__label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 300;
  color: #999;
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

@keyframes polaroidDrop {
  0%   { opacity: 0; transform: var(--p-base) translateY(-40px) scale(0.85); }
  60%  { opacity: 1; transform: var(--p-base) translateY(6px) scale(1.02); }
  80%  { transform: var(--p-base) translateY(-3px) scale(0.99); }
  100% { opacity: 1; transform: var(--p-base); }
}

@keyframes polaroidFadeOut {
  0%   { opacity: 1; transform: var(--p-base); }
  100% { opacity: 0; transform: var(--p-base) translateY(20px) scale(0.9); }
}

.polaroid.dropping {
  animation: polaroidDrop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.polaroid.fading {
  animation: polaroidFadeOut 0.35s ease-in forwards;
}
