/*
Theme Name: Unlucky
Author: Unlucky
Description: Minimal single-page prank site with first-party aggregate analytics.
Version: 1.5.7
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: unlucky
*/

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #171717;
  --muted: #767676;
  --line: #deded9;
  --soft: #ecece8;
  --radius: 16px;
  --page-pad: clamp(20px, 4vw, 56px);
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --link-emphasis: 0.35px 0 0 currentColor, -0.35px 0 0 currentColor;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--page-pad);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header {
  min-height: 76px;
  border-bottom: 0;
}

.site-logo {
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.site-logo:hover,
.site-logo:focus-visible {
  text-shadow: none;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.text-action {
  appearance: none;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.text-action:hover,
.text-action:focus-visible {
  color: var(--text);
  text-shadow: var(--link-emphasis);
  text-decoration: none;
}

.shop-action {
  display: inline-flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 6px;
  white-space: nowrap;
  width: auto;
}

.shop-icon {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 48px 0;
}

.hero {
  width: min(760px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(64px, min(10.5vw, 15vh), 126px);
  line-height: 0.9;
  letter-spacing: -0.07em;
  font-weight: 700;
}

.hero-copy {
  margin: 22px 0 0;
  font-size: clamp(19px, 2.05vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 400;
}

.luck-button {
  margin-top: 34px;
  appearance: none;
  border: 1px solid #171717;
  border-radius: 10px;
  background: #171717;
  color: #fff;
  padding: 14px 28px;
  min-width: 190px;
  cursor: pointer;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.10);
  transition: transform 100ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.luck-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.13);
}

.luck-button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.luck-button:focus-visible {
  outline: 3px solid rgba(23, 23, 23, 0.22);
  outline-offset: 4px;
}

.luck-button:disabled {
  cursor: default;
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

.luck-button:disabled:hover,
.luck-button:disabled:active {
  transform: none;
  box-shadow: none;
}

.hero-microcopy {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.result-wrap {
  min-height: 54px;
  width: min(520px, 100%);
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.luck-result {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.025em;
  opacity: 0;
  transform: translateY(5px);
}

.luck-result.is-visible {
  animation: unlucky-result-in 220ms ease forwards;
}

@keyframes unlucky-result-in {
  to { opacity: 1; transform: translateY(0); }
}

.site-footer {
  min-height: 66px;
  border-top: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.footer-privacy {
  text-decoration: none;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.footer-privacy:hover,
.footer-privacy:focus-visible {
  color: var(--text);
  text-shadow: var(--link-emphasis);
  text-decoration: none;
}

/* The front page is intentionally a single-screen composition on desktop. */
body.unlucky-front {
  overflow-x: hidden;
}

@media (min-width: 641px) {
  body.unlucky-front {
    height: 100vh;
    height: 100dvh;
    overflow-y: hidden;
  }

  body.unlucky-front .site-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  /* WordPress adds a top admin-bar offset when logged in. Keep the page
     inside the remaining viewport so testing as an admin does not add scroll. */
  body.admin-bar.unlucky-front,
  body.admin-bar.unlucky-front .site-shell {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
  }

  body.unlucky-front .site-header {
    flex: 0 0 68px;
    min-height: 68px;
    border-bottom: 0;
  }

  body.unlucky-front .home-main {
    flex: 1 1 auto;
    min-height: 0;
    padding: clamp(18px, 3.5vh, 42px) 0;
  }

  body.unlucky-front .site-footer {
    flex: 0 0 58px;
    min-height: 58px;
    border-top: 0;
  }
}

@media (min-width: 641px) and (max-width: 782px) {
  body.admin-bar.unlucky-front,
  body.admin-bar.unlucky-front .site-shell {
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
  }
}

@media (min-width: 641px) and (max-height: 720px) {
  body.unlucky-front .hero-title {
    font-size: clamp(58px, min(9vw, 13vh), 96px);
  }

  body.unlucky-front .hero-copy { margin-top: 16px; }
  body.unlucky-front .luck-button { margin-top: 26px; }
  body.unlucky-front .result-wrap { margin-top: 18px; min-height: 48px; }
}

.unlucky-dialog[hidden] { display: none; }

.unlucky-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.23);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: unlucky-fade 160ms ease both;
}

.dialog-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  border: 1px solid #d7d7d2;
  border-radius: 20px;
  background: var(--surface);
  padding: clamp(34px, 5vw, 48px) clamp(28px, 5vw, 46px);
  box-shadow: 0 26px 72px rgba(0,0,0,0.12);
  text-align: center;
  animation: unlucky-dialog-in 190ms ease both;
}

.dialog-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.052em;
  font-weight: 700;
}

.dialog-body {
  margin: 14px 0 0;
  color: #4d4d4a;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.dialog-body + .dialog-body { margin-top: 4px; }

.dialog-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  margin-top: 30px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  color: var(--text);
  text-shadow: var(--link-emphasis);
  text-decoration: none;
}

@keyframes unlucky-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes unlucky-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

body.unlucky-dialog-open { overflow: hidden; }

/* Privacy */
.privacy-main {
  flex: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 78px 0 96px;
}

.privacy-kicker {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.privacy-title {
  margin: 0 0 50px;
  font-size: clamp(44px, 8vw, 88px);
  line-height: .95;
  letter-spacing: -0.06em;
  font-weight: 700;
}

.privacy-content {
  font-size: 16px;
  line-height: 1.72;
}

.privacy-content h2 {
  margin: 44px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.privacy-content h3 { margin: 30px 0 8px; }
.privacy-content p { margin: 0 0 18px; }
.privacy-content ul { padding-left: 22px; }
.privacy-content li { margin-bottom: 8px; }
.privacy-content a {
  text-decoration: none;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.privacy-content a:hover,
.privacy-content a:focus-visible {
  color: var(--text);
  text-shadow: var(--link-emphasis);
  text-decoration: none;
}

.unlucky-placeholder {
  display: inline-block;
  border: 1px dashed #aaa;
  border-radius: 5px;
  padding: 0 5px;
  background: #fff8cc;
  font-weight: 700;
}

@media (max-width: 640px) {
  .site-header { min-height: 70px; }
  .header-actions { gap: 14px; }
  .text-action { font-size: 12px; }
  .home-main { padding: 50px 0; }
  .hero-title { font-size: clamp(58px, 18vw, 88px); }
  .hero-copy { margin-top: 22px; }
  .luck-button { margin-top: 34px; }
  .site-footer { min-height: 68px; gap: 14px; }
  .privacy-main { padding-top: 54px; }
  .dialog-panel { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 404 */
.not-found-main {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 0;
}

.not-found-inner {
  transform: translateY(-2vh);
}

.not-found-title {
  margin: 0;
  font-size: clamp(88px, 16vw, 180px);
  line-height: .88;
  letter-spacing: -0.065em;
  font-weight: 700;
}

.not-found-copy {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.not-found-link {
  display: inline-block;
  margin-top: 34px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.not-found-link:hover,
.not-found-link:focus-visible {
  color: var(--text);
  text-shadow: var(--link-emphasis);
  text-decoration: none;
}
