/* ==========================================================================
   Creative Developer — a front-end study of wodniack.dev's hero
   Palette, grid and type scale are rebuilt from the reference.
   ========================================================================== */

@font-face {
  font-family: "Saira XCond";
  src: url("../fonts/saira-extra-condensed-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --fg: #d4af37;
  --paper: #0a0a0a;
  --head-h: 6rem;
  --sep-h: 2.25rem;
  --gutter: 1.5rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --font-display: "Saira XCond", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-mono: "Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
}

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

html {
  background: var(--bg);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  background: var(--fg);
  color: var(--paper);
  font: 400 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--paper);
}

/* ==========================================================================
   Intro curtain
   A black edge rises from the bottom to the title line. Its two sides lead
   in an arc, then the middle catches up; the cloth below squeezes into a
   strip, the strip expands back, and the whole cloth slides away.
   The edge is an SVG path driven by js/main.js; the rest is CSS.
   ========================================================================== */

:root {
  --intro-line: 66%;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
}

.intro.is-skipped {
  display: none;
}

.intro__curtain {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-top: 1px solid var(--fg);
  will-change: top, clip-path;
  animation:
    intro-curtain 2.7s cubic-bezier(0.65, 0, 0.35, 1) forwards,
    intro-cloth-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards,
    intro-cloth-out 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

@keyframes intro-curtain {
  0% {
    top: 100%;
  }
  22.2% {
    top: var(--intro-line);
  }
  55.6% {
    top: var(--intro-line);
  }
  100% {
    top: 100%;
  }
}

@keyframes intro-cloth-in {
  from {
    clip-path: inset(0);
  }
  to {
    clip-path: inset(0 0 94% 0);
  }
}

@keyframes intro-cloth-out {
  from {
    clip-path: inset(0 0 94% 0);
  }
  to {
    clip-path: inset(0);
  }
}

.intro__rules {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.intro__rules i {
  position: absolute;
  top: 101%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--fg);
  opacity: 1;
  will-change: top, opacity;
}

html.is-intro .site-head,
html.is-intro .title,
html.is-intro .separator {
  opacity: 0;
}

html.is-intro .waves {
  opacity: 0;
}

html.is-wave .waves,
html.js.is-wave .waves {
  opacity: 1;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }

  .waves {
    clip-path: none;
  }
}

/* ==========================================================================
   Site head
   ========================================================================== */

.site-head {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--fg);
  background: var(--bg);
}

.head {
  display: flex;
  align-items: stretch;
  height: var(--head-h);
  width: 100%;
}

.brand {
  display: grid;
  place-items: center;
  flex: 0 0 var(--head-h);
  width: var(--head-h);
  border-right: 1px solid var(--fg);
  color: var(--fg);
}

.brand svg {
  display: block;
  width: 3rem;
  height: 3rem;
  fill: currentColor;
  transition: transform 0.7s var(--ease-out);
}

.brand:hover svg {
  transform: translateY(-3px);
}

.console {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
  margin: 0;
  padding: 1rem var(--gutter) 1.35rem;
  overflow: hidden;
  font: 400 9px/1.55 var(--font-mono);
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.console p {
  margin: 0;
  max-width: 100%;
}

.caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.25em;
  background: currentColor;
  vertical-align: -0.12em;
  animation: caret-blink 1.1s steps(1, end) infinite;
}

@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.nav {
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
  border-left: 1px solid var(--fg);
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 2rem 3rem;
  color: var(--fg);
  font: 400 14px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%3E%3Crect%20x='5.5'%20y='5.5'%20width='9'%20height='9'%20fill='%23d4af37'%20stroke='%230a0a0a'/%3E%3C/svg%3E") 10 10, pointer;
}

.nav a span {
  position: relative;
  display: inline-block;
}

.nav a span::before {
  position: absolute;
  top: calc(50% - 3px);
  left: -13px;
  width: 6px;
  height: 6px;
  background: currentColor;
  opacity: 0;
  content: "";
}

.nav a:hover {
  text-shadow: 0 0 1px currentColor;
}

.nav a:hover span::before {
  animation: blink-in 0.3s cubic-bezier(1, 0, 0, 1) forwards;
}

@keyframes blink-in {
  0%,
  30%,
  60% {
    opacity: 0;
  }
  15%,
  45%,
  75%,
  100% {
    opacity: 1;
  }
}

.socials {
  display: flex;
  flex: 0 0 3rem;
  flex-direction: column;
  width: 3rem;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--fg);
  list-style: none;
}

.socials li {
  height: 3rem;
  border-bottom: 1px solid var(--fg);
}

.socials li:last-child {
  border-bottom: 0;
}

.socials a {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--fg);
  text-decoration: none;
}

.socials a::before {
  position: absolute;
  inset: 0;
  background: var(--fg);
  content: "";
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.45s var(--ease-out);
}

.socials a:hover {
  color: var(--bg);
}

.socials a:hover::before {
  transform: scaleX(1);
}

.socials a > * {
  position: relative;
  z-index: 1;
}

.socials svg {
  display: block;
  width: 20px;
  height: 20px;
}

.in {
  font: 900 16px/1 var(--font-display);
  letter-spacing: -0.01em;
}

.availability {
  display: flex;
  flex: 0 0 20.5rem;
  flex-direction: column;
  width: 20.5rem;
  border-left: 1px solid var(--fg);
}

.availability p {
  display: flex;
  flex: 1 1 50%;
  align-items: center;
  gap: 0.3em;
  margin: 0;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--fg);
  font: 400 1rem/1 var(--font-serif);
  letter-spacing: 0;
  white-space: nowrap;
}

.availability p:last-child {
  border-bottom: 0;
}

.contrast {
  display: grid;
  place-items: center;
  flex: 0 0 3rem;
  width: 3rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background-color 0.25s linear, color 0.25s linear;
}

.contrast svg {
  display: block;
  width: 20px;
  height: 20px;
}

.contrast:hover {
  background: var(--fg);
  color: var(--bg);
}

.qr {
  position: relative;
  flex: 0 0 var(--head-h);
  width: var(--head-h);
  overflow: hidden;
  border-left: 1px solid var(--fg);
  background: var(--bg);
}

.qr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 42%;
  filter: contrast(1.06);
  transform: scale(1.22);
  transform-origin: 64% 42%;
}

.qr-img--dark {
  display: block;
}

.qr-img--light {
  display: none;
}

html.is-contrast .qr-img--dark {
  display: none;
}

html.is-contrast .qr-img--light {
  display: block;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--head-h) - 1px);
  min-height: calc(100svh - var(--head-h) - 1px);
}

.waves {
  position: relative;
  flex: 1 1 auto;
  min-height: 19rem;
  overflow: hidden;
  background: var(--bg);
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  will-change: clip-path;
}

.waves__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.waves__svg path {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* --- binary separator ---------------------------------------------------- */

.separator {
  display: flex;
  flex: 0 0 var(--sep-h);
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  height: var(--sep-h);
  padding: 0 1rem;
  overflow: hidden;
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--fg);
}

.sep-arrow {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  border-left: 4px solid currentColor;
}

.sep-arrow--end {
  transform: rotate(180deg);
}

.sep-group {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}

.sep-bin {
  display: inline-flex;
  letter-spacing: -0.04em;
}

.sep-bin span {
  display: inline-block;
  width: 1ch;
  text-align: center;
}

.sep-bin span.is-blank {
  width: 0.62ch;
}

.sep-slash {
  overflow: hidden;
  letter-spacing: -0.08em;
  text-overflow: clip;
}

/* --- title --------------------------------------------------------------- */

.title-link {
  position: relative;
  z-index: 5;
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.title-link .title {
  cursor: pointer;
}

.title {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.08em;
  margin: 0;
  padding: 1.1rem 0 1.35rem;
  font-family: var(--font-display);
  font-size: min(14.5vw, 18rem);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.title__hint {
  margin: 0.85rem 0 0.65rem;
  color: var(--fg);
  font: 400 0.75rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-align: center;
  opacity: 0.78;
  user-select: none;
}

.title__dots {
  display: inline-block;
  width: 3.6ch;
  text-align: left;
}

.title__word {
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0.05em 0 0.06em;
}

.title__word > span {
  display: block;
}

.star {
  display: block;
  flex: 0 0 auto;
  width: 0.22em;
  height: 0.22em;
  margin: 0 0.05em;
  fill: var(--fg);
  transform-origin: 50% 50%;
  transition: transform 0.9s var(--ease-out);
}

.title:hover .star {
  transform: rotate(90deg) scale(1.08);
}

/* ==========================================================================
   Entrance choreography — CSS animates once .is-ready lands on <html>
   ========================================================================== */

html.js .head > * {
  opacity: 0;
  transform: translateY(-7px);
}

html.js .title {
  opacity: 0;
}

html.js .title__word > span {
  transform: translateY(112%);
}

html.js .waves {
  opacity: 0;
}

html.js .separator {
  opacity: 0;
}

html.is-ready .head > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease-out) var(--d, 0s),
              transform 0.5s var(--ease-out) var(--d, 0s);
}

html.is-ready .title {
  opacity: 1;
  transition: opacity 0.8s ease 0.15s;
}

html.js .title__hint {
  opacity: 0;
  transform: translateY(8px);
}

html.is-ready .title__hint {
  opacity: 0.78;
  transform: translateY(0);
  transition: opacity 0.7s ease 0.35s, transform 0.7s var(--ease-out) 0.35s;
}

html.is-ready .title__word > span {
  transform: translateY(0);
  transition: transform 0.9s var(--ease-out) var(--d, 0s);
}

html.is-ready .waves {
  opacity: 1;
  transition: opacity 1s linear 0.05s;
}

html.is-ready .separator {
  opacity: 1;
  transition: opacity 0.6s linear var(--d, 0s);
}

.head > *:nth-child(1) { --d: 0s; }
.head > *:nth-child(2) { --d: 0.05s; }
.head > *:nth-child(3) { --d: 0.1s; }
.head > *:nth-child(4) { --d: 0.15s; }
.head > *:nth-child(5) { --d: 0.2s; }
.head > *:nth-child(6) { --d: 0.25s; }
.head > *:nth-child(7) { --d: 0.3s; }

.title__word:first-child > span { --d: 0.18s; }
.title__word:last-child > span { --d: 0.28s; }

.separator--top { --d: 0.3s; }
.separator--bottom { --d: 0.5s; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1440px) {
  .nav a {
    padding: 2rem 2.25rem;
  }
}

@media (max-width: 1280px) {
  :root {
    --gutter: 1.25rem;
  }

  .nav a {
    padding: 2rem 1.5rem;
  }

  .availability {
    flex-basis: 21rem;
    width: 21rem;
  }

  .availability p {
    font-size: 0.95rem;
  }
}

@media (max-width: 1100px) {
  .console {
    padding: 1rem;
  }

  .nav a {
    padding: 2rem 1.2rem;
  }

  .availability {
    flex-basis: 20rem;
    width: 20rem;
  }

  .availability p {
    padding: 0 1rem;
    font-size: 0.95rem;
  }
}

/* Not enough room for the menu and the console at the same time. */
@media (max-width: 1080px) {
  .nav {
    display: none;
  }
}

@media (max-width: 880px) {
  .availability p {
    font-size: 0.9rem;
  }

  .title {
    font-size: 14.8vw;
  }
}

/* One line of availability copy, no console: the hero takes the full width. */
@media (max-width: 760px) {
  .console {
    display: none;
  }

  .availability {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .availability p:first-child {
    display: none;
  }

  .availability p {
    height: var(--head-h);
    flex: 0 0 var(--head-h);
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --head-h: 4rem;
    --sep-h: 2rem;
    --gutter: 0.75rem;
  }

  .brand svg {
    width: 2rem;
    height: 2rem;
  }

  .console,
  .socials,
  .contrast {
    display: none;
  }

  .availability {
    flex: 1 1 auto;
    border-left: 0;
  }

  .availability p {
    font-size: 0.82rem;
    padding: 0 0.85rem;
  }

  .qr {
    flex-basis: 4rem;
    width: 4rem;
    padding: 0;
  }

  .title {
    gap: 0.06em;
    padding: 0.65rem 0 0.85rem;
    font-size: 14vw;
    letter-spacing: -0.018em;
  }

  .separator {
    gap: 0.8rem;
    padding: 0 0.6rem;
    font-size: 7px;
  }

  .waves {
    min-height: 15rem;
  }
}

@media (max-width: 400px) {
  .availability p {
    font-size: 0.76rem;
  }
}

/* ==========================================================================
   Contrast mode (the half-disc button in the header)
   ========================================================================== */

html.is-contrast {
  --bg: #f4ecd8;
  --fg: #111111;
}

body,
.site-head,
.waves {
  transition: background-color 0.35s linear;
}

/* ==========================================================================
   Title link — page reveal into the shuike-home index
   ========================================================================== */

.waves {
  position: relative;
  z-index: 5;
}

.separator,
.title-link {
  position: relative;
  z-index: 5;
  background: var(--bg);
}

.page-reveal {
  position: fixed;
  top: var(--intro-line, 66vh);
  left: 0;
  z-index: 4;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.page-reveal iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

html.is-leaving {
  overflow: hidden;
}

html.is-leaving body {
  overflow: hidden;
}

html.is-leaving .title-link {
  pointer-events: none;
}

html.is-leaving .site-head,
html.is-leaving .waves,
html.is-leaving .page-reveal {
  will-change: transform;
}

html.is-promoted {
  overflow: hidden;
}

html.is-promoted body {
  overflow: hidden;
}

html.is-promoted .page-reveal {
  z-index: 100000;
  pointer-events: auto;
}

html.is-promoted .site-head,
html.is-promoted .hero {
  visibility: hidden;
}

/* ==========================================================================
   Reduced motion / no JS
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html.js .title,
  html.js .title__hint,
  html.js .head > *,
  html.js .title__word > span,
  html.js .waves,
  html.js .separator {
    opacity: 1;
    transform: none;
  }

  .title:hover .star {
    transform: none;
  }

  .caret {
    animation: none;
  }

  .socials a::before,
  .brand svg {
    transition: none;
  }
}

html:not(.js) .head > *,
html:not(.js) .title__hint,
html:not(.js) .title__word > span,
html:not(.js) .waves,
html:not(.js) .separator {
  opacity: 1;
  transform: none;
}

.contact-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
