/* =========================================================
   Rez-works — design-tool inspired studio site
   Palette: warm paper canvas · ink · vermilion signal
   ========================================================= */

:root {
  --paper:      #F2EEE4;
  --paper-2:    #FBFAF5;
  --ink:        #16150F;
  --ink-soft:   #55524A;
  --ink-faint:  #8B887E;
  --line:       rgba(22, 21, 15, 0.13);
  --line-strong:rgba(22, 21, 15, 0.28);
  --accent:     #FF4A1C;   /* vermilion */
  --accent-ink: #C8330C;
  --surface:    #FFFFFF;

  /* multiplayer cursor colors */
  --cur-blue:   #2C6BED;
  --cur-green:  #17A46A;
  --cur-purple: #7C4DFF;

  --dark:       #16150F;
  --dark-soft:  #26241C;

  --font-display: "Bricolage Grotesque", "Zen Kaku Gothic New", sans-serif;
  --font-body:    "Instrument Sans", "Zen Kaku Gothic New", sans-serif;
  --font-jp:      "Zen Kaku Gothic New", sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Dot-grid canvas texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.6;
  mask-image: linear-gradient(to bottom, #000, #000);
}

main, .toolbar, .footer { position: relative; z-index: 1; }

:where(h1, h2, h3) { font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); }
.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.02em; }

::selection { background: var(--accent); color: var(--paper-2); }

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 0.85em 1.5em; border-radius: 100px;
  border: 1.5px solid var(--ink); cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s, color 0.3s, box-shadow 0.35s var(--ease);
  will-change: transform;
}
.btn--solid { background: var(--ink); color: var(--paper-2); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 30px -12px rgba(255,74,28,0.7); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper-2); transform: translateY(-3px); }
.btn--pill { padding: 0.6em 1.15em; font-size: 0.9rem; }
.btn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255,74,28,0.55); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255,74,28,0.55); } 70%,100% { box-shadow: 0 0 0 7px rgba(255,74,28,0); } }

/* -------------------- Toolbar / Nav -------------------- */
.toolbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.4rem);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.brand__mark { display: inline-flex; width: 34px; height: 34px; color: var(--ink); }
.brand__mark svg { width: 100%; height: 100%; }
.brand__wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.28rem; letter-spacing: -0.03em; }
.brand__dash { color: var(--accent); }

.toolbar__nav { display: flex; gap: 0.4rem; }
.toolbar__nav a {
  font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
  padding: 0.45em 0.85em; border-radius: 100px; position: relative;
  transition: color 0.25s, background 0.25s;
}
.toolbar__nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.toolbar__cta { flex-shrink: 0; }

/* -------------------- Hero -------------------- */
.hero {
  position: relative;
  padding: clamp(4rem, 11vw, 8.5rem) clamp(1.2rem, 5vw, 3rem) clamp(3rem, 7vw, 5rem);
  max-width: var(--maxw); margin: 0 auto;
  text-align: center;
}
.hero__meta {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem;
  font-size: 0.74rem; color: var(--ink-faint); text-transform: uppercase;
  margin-bottom: clamp(1.5rem, 4vw, 2.4rem);
}
.hero__meta-sep { color: var(--accent); }

.hero__title {
  font-size: clamp(2.7rem, 9.5vw, 6.3rem);
  font-weight: 800; letter-spacing: -0.035em;
  margin-bottom: 1.6rem;
}
.hero__title .line { display: block; }
.hero__title em { font-style: normal; color: var(--accent); }

.hero__lead {
  max-width: 640px; margin: 0 auto 2.4rem;
  font-size: clamp(1rem, 2.4vw, 1.18rem); color: var(--ink-soft);
}
.hero__lead strong { color: var(--ink); font-weight: 700; }

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; }

.hero__scroll {
  margin-top: clamp(2.5rem, 6vw, 4rem); font-size: 0.72rem; color: var(--ink-faint);
  letter-spacing: 0.25em; animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* floating cursors */
.cursors { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.cursor {
  position: absolute; display: inline-flex; align-items: flex-start; gap: 3px;
  animation: drift 9s ease-in-out infinite;
}
.cursor svg { width: 26px; height: 26px; fill: var(--c); filter: drop-shadow(0 3px 6px rgba(0,0,0,0.18)); }
.cursor b {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; color: var(--paper-2);
  background: var(--c); padding: 2px 7px; border-radius: 5px 5px 5px 0; transform: translateY(4px);
  white-space: nowrap;
}
.cursor--1 { top: 14%; left: 7%;  animation-delay: 0s; }
.cursor--2 { top: 30%; right: 8%; animation-delay: -3s; }
.cursor--3 { bottom: 30%; left: 11%; animation-delay: -5s; }
.cursor--4 { bottom: 20%; right: 12%; animation-delay: -1.5s; }
@keyframes drift { 0%,100% { transform: translate(0,0); } 25% { transform: translate(14px,-16px); } 50% { transform: translate(-10px,10px); } 75% { transform: translate(8px,14px); } }

/* -------------------- Marquee -------------------- */
.marquee {
  border-block: 1.5px solid var(--ink); background: var(--accent); color: var(--paper-2);
  overflow: hidden; padding: 0.7rem 0;
}
.marquee__track {
  display: inline-flex; align-items: center; gap: 1.4rem; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
  animation: scroll 32s linear infinite;
}
.marquee__track .dot { font-size: 0.5rem; opacity: 0.7; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* -------------------- Sections -------------------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(4.5rem, 11vw, 8rem) clamp(1.2rem, 5vw, 3rem);
}
.section__head { max-width: 720px; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.tag {
  display: inline-block; font-size: 0.74rem; color: var(--accent-ink);
  letter-spacing: 0.14em; margin-bottom: 1rem;
}
.section__title { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; }
.section__intro { margin-top: 1.1rem; color: var(--ink-soft); font-size: clamp(1rem, 2.3vw, 1.12rem); max-width: 560px; }

/* -------------------- Service frames -------------------- */
.frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; }
.frame {
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: 16px;
  overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.frame:hover { transform: translateY(-6px); box-shadow: -6px 12px 0 -2px var(--accent); }
.frame__bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.9rem; font-size: 0.68rem; color: var(--ink-faint);
  border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.frame__body { padding: 1.6rem 1.5rem 1.8rem; }
.frame__num { display: block; font-size: 0.78rem; color: var(--accent); margin-bottom: 0.8rem; }
.frame__body h3 { font-size: 1.42rem; margin-bottom: 0.7rem; }
.frame__body p { color: var(--ink-soft); font-size: 0.96rem; }
.frame__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.2rem 0 0; padding: 0; }
.frame__tags li { font-size: 0.68rem; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 100px; padding: 0.25em 0.7em; }

/* -------------------- Dark section (process) -------------------- */
.section--dark {
  max-width: none; background: var(--dark); color: var(--paper);
  margin-block: clamp(2rem, 5vw, 4rem) 0;
  border-radius: 34px; position: relative;
}
.section--dark { padding-inline: clamp(1.5rem, 6vw, 5rem); }
.section--dark .section__head { margin-inline: auto; max-width: var(--maxw); }
.section--dark .section__intro { color: #B6B2A6; }
.section--dark .tag { color: var(--accent); }
.steps {
  list-style: none; margin: 0 auto; padding: 0; max-width: var(--maxw);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0;
  border-top: 1px solid rgba(255,255,255,0.16);
}
.step {
  padding: 2rem 1.6rem 2.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.16);
  border-right: 1px solid rgba(255,255,255,0.16);
  padding-left: 1.6rem; position: relative;
  transition: background 0.3s;
}
.step:hover { background: rgba(255,255,255,0.03); }
.step__no { display: block; font-size: 0.72rem; color: var(--accent); margin-bottom: 1.2rem; }
.step h3 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.step p { color: #B6B2A6; font-size: 0.93rem; }

/* -------------------- Works -------------------- */
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.work { display: block; }
.work__thumb {
  aspect-ratio: 4 / 3; border-radius: 16px; border: 1.5px solid var(--ink);
  display: grid; place-items: center; overflow: hidden; position: relative;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.work__thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 18px 18px; opacity: 0.25;
}
.work__thumb--a { background: linear-gradient(135deg, #FF4A1C, #FF8A5B); }
.work__thumb--b { background: linear-gradient(135deg, #16150F, #3a382c); }
.work__thumb--c { background: linear-gradient(135deg, #2C6BED, #7C4DFF); }
.work__thumb--squish { background: radial-gradient(120% 120% at 30% 20%, #EDE9FF 0%, #DCD4FB 55%, #C9BEF7 100%); }
.work__thumb--squish::after { opacity: 0.15; }
.work__glyph { font-size: 4rem; color: rgba(255,255,255,0.92); transition: transform 0.5s var(--ease); }
.work__appicon {
  width: 46%; max-width: 150px; height: auto; position: relative; z-index: 1;
  border-radius: 22%; filter: drop-shadow(0 16px 26px rgba(76, 54, 160, 0.34));
  transition: transform 0.5s var(--ease);
}
.work__badge {
  position: absolute; top: 0.85rem; left: 0.85rem; z-index: 1;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--ink); background: rgba(255,255,255,0.92);
  padding: 0.25em 0.6em; border-radius: 100px;
}
.work__sample { color: var(--ink-faint); font-weight: 400; }
.work:hover .work__thumb { transform: translateY(-6px); box-shadow: 0 22px 40px -20px rgba(0,0,0,0.4); }
.work:hover .work__glyph { transform: scale(1.15) rotate(8deg); }
.work:hover .work__appicon { transform: scale(1.08) rotate(-3deg); }

/* -------------------- Featured single work -------------------- */
.feature {
  display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(1.5rem, 4vw, 3.4rem);
  align-items: center;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: 22px;
  padding: clamp(1.1rem, 2.6vw, 1.8rem);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: -8px 14px 0 -2px var(--accent); }
.feature__visual {
  position: relative; aspect-ratio: 4 / 3; border-radius: 16px;
  display: grid; place-items: center; overflow: hidden;
}
.feature__visual .work__appicon { width: 44%; max-width: 168px; }
.feature:hover .work__appicon { transform: scale(1.07) rotate(-3deg); }
.feature__body { padding: 0.4rem 0.6rem; }
.feature__kicker { display: block; font-size: 0.74rem; color: var(--ink-faint); letter-spacing: 0.08em; }
.feature__title { font-size: clamp(2rem, 5vw, 3rem); margin: 0.4rem 0 0.8rem; letter-spacing: -0.03em; }
.feature__desc { color: var(--ink-soft); font-size: 1rem; max-width: 46ch; }
.feature__download { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.1rem; margin-top: 1.6rem; }
.btn__icon { width: 18px; height: 18px; }
.btn--solid .btn__icon { transition: transform 0.35s var(--ease); }
.btn--solid:hover .btn__icon { transform: translateY(2px); }
.feature__note { font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0.04em; }
.feature__hint { margin-top: 0.9rem; font-size: 0.82rem; color: var(--ink-faint); }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature__body { padding: 0.2rem; }
}
.work__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1rem; padding-inline: 0.2rem; }
.work__meta h3 { font-size: 1.15rem; }
.work__meta .mono { font-size: 0.72rem; color: var(--ink-faint); flex-shrink: 0; }

/* -------------------- About -------------------- */
.section--about { }
.about { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about__left .section__title { margin-top: 0.4rem; }
.about__lead { font-size: clamp(1.15rem, 2.6vw, 1.4rem); font-weight: 700; margin: 1.6rem 0 1.2rem; letter-spacing: -0.01em; }
.about__left p { color: var(--ink-soft); margin-bottom: 1rem; }
.about__facts { margin: 2rem 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.about__facts div { display: flex; gap: 1.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.about__facts dt { color: var(--ink-faint); width: 4.5rem; flex-shrink: 0; margin: 0; }
.about__facts dd { margin: 0; color: var(--ink); }

.cardface {
  background: var(--dark); border-radius: 22px; overflow: hidden; color: var(--paper);
  border: 1.5px solid var(--ink); box-shadow: -10px 16px 0 -2px var(--accent);
  transform: rotate(-2.5deg); transition: transform 0.5s var(--ease);
}
.cardface:hover { transform: rotate(0deg) scale(1.02); }
.cardface__bar { display: flex; justify-content: space-between; padding: 0.6rem 1rem; font-size: 0.7rem; color: #B6B2A6; border-bottom: 1px solid rgba(255,255,255,0.14); letter-spacing: 0.3em; }
.cardface__logo { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2.8rem 1.5rem 3rem; color: var(--paper); }
.cardface__logo svg { width: 74px; height: 74px; }
.cardface__name { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.03em; margin-top: 0.4rem; }
.cardface__role { font-size: 0.68rem; color: #B6B2A6; letter-spacing: 0.08em; }

/* -------------------- Contact -------------------- */
.contact { text-align: center; }
.contact__title { font-size: clamp(2.2rem, 7vw, 4.4rem); font-weight: 800; letter-spacing: -0.03em; margin: 0.6rem 0 1.4rem; }
.contact__lead { color: var(--ink-soft); font-size: clamp(1rem, 2.4vw, 1.15rem); margin-bottom: 2.4rem; }
.contact__mail {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 2.8rem); letter-spacing: -0.02em;
  border-bottom: 3px solid var(--accent); padding-bottom: 0.1em; margin-bottom: 2.2rem;
  transition: color 0.3s, transform 0.3s var(--ease);
}
.contact__mail:hover { color: var(--accent); transform: translateY(-2px); }
.contact__sub { display: flex; justify-content: center; }

/* -------------------- Footer -------------------- */
.footer {
  border-top: 1.5px solid var(--ink);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.2rem, 5vw, 3rem) 2.5rem;
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: 1.8rem;
}
.footer__brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.footer__brand .brand__mark { width: 30px; height: 30px; color: var(--ink); }
.footer__brand .brand__wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer__nav a { font-size: 0.92rem; color: var(--ink-soft); transition: color 0.25s; }
.footer__nav a:hover { color: var(--accent); }
.footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; font-size: 0.74rem; color: var(--ink-faint); padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* -------------------- Reveal animation -------------------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* -------------------- Responsive -------------------- */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__right { order: -1; display: flex; justify-content: center; }
  .cardface { max-width: 320px; width: 100%; }
  .toolbar__nav { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero__actions .btn, .contact__sub .btn { width: 100%; justify-content: center; }
  .cursor--1 { left: 2%; } .cursor--2 { right: 2%; } .cursor--3 { left: 4%; } .cursor--4 { right: 4%; }
}

/* -------------------- Reduced motion -------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
