:root {
  --pink: #ff4fa3;
  --pink-deep: #d92f80;
  --ink: #121111;
  --ink-2: #1b1a1a;
  --line: #343030;
  --paper: #f4efe8;
  --muted: #9b958e;
  --error: #ff2d3d;
  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film grain, so the black doesn't feel flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

a { color: inherit; }

/* ---------- Logo with eyes ---------- */
.logo {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  user-select: none;
}
.logo em { font-style: normal; color: var(--pink); }

.eye {
  --close: 0; /* 0 = open, 1 = closed */
  position: relative;
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin: 0 0.035em;
  border-radius: 50%;
  background: var(--paper);
  vertical-align: -0.02em;
  overflow: hidden;
  isolation: isolate;
}
.pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.27em;
  height: 0.27em;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  will-change: transform;
}
.pupil::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 22%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: var(--paper);
}

/* Eyelids: slide in from the top and bottom and meet in the middle */
.lid {
  position: absolute;
  left: -5%;
  width: 110%;
  background: #ddd3c5;
  transition: transform 0.22s cubic-bezier(0.45, 0, 0.25, 1);
}
/* Top lid sits above the bottom one; when closed they overlap into one sleepy curve */
.lid-top {
  top: 0;
  height: 58%;
  z-index: 2;
  border-bottom: 0.035em solid var(--ink);
  border-radius: 0 0 50% 50% / 0 0 38% 38%;
  transform: translateY(calc((var(--close) - 1) * 104%));
}
.lid-bottom {
  bottom: 0;
  height: 50%;
  z-index: 1;
  border-top: 0.02em solid var(--ink);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  transform: translateY(calc((1 - var(--close)) * 104%));
}

.logo.peek .eye { --close: 0.55; }  /* password shown: peeking */
.logo.shy .eye,
.eye.blink { --close: 1; }          /* typing a password, or blinking */
.eye.blink .lid { transition-duration: 0.09s; }

/* ---------- Pop-up card ---------- */
.modal-wrap {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 0 10px 10px 0;
  filter: drop-shadow(8px 8px 0 var(--pink));
  transform: scale(0.2);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1.2, 0.36, 1), opacity 0.2s ease-out;
}
.overlay.open .modal-wrap { transform: scale(1); opacity: 1; }

.modal-card {
  background: var(--ink-2);
  border: 2px solid var(--paper);
  border-radius: 16px;
}

.modal-body { padding: 24px 28px 26px; }

.modal-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 22px;
}
.modal-card h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.logo-mini { font-size: 2.1rem; }

.close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  margin-left: -8px;
}
.close svg { width: 20px; height: 20px; stroke: var(--paper); stroke-width: 2; stroke-linecap: round; }
.close:hover { background: var(--line); }


/* ---------- Home (X-style split) ---------- */
.home {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 48px);
  gap: 32px;
}
.home-logo { display: flex; justify-content: center; }
.logo-big { font-family: "Lexend", var(--display); font-size: clamp(5.5rem, 17vw, 15rem); }
.logo-big .line { display: block; }
.logo-big .eye { width: 0.56em; height: 0.56em; vertical-align: 0; }
.logo-big .line + .line { margin-top: 0.02em; }

.home-cta { max-width: 400px; }
.headline {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 5.2vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 44px;
}
.join {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.cta-buttons { max-width: 320px; }
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.legal { font-size: 0.75rem; color: var(--muted); line-height: 1.45; margin-top: 10px; }
.legal a { color: var(--pink); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

.have-account { max-width: 320px; margin-top: 52px; }
.have-account p { font-weight: 700; font-size: 1.05rem; margin-bottom: 18px; }

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 14px 16px 18px;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--paper); text-decoration: underline; }

/* ---------- Pop-up ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 9, 9, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.overlay.open { opacity: 1; visibility: visible; }

.modal-foot {
  border-top: 1px solid var(--line);
  padding: 18px 28px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Bigger pop-ups: log in, forgot password, new password */
.modal-lg { max-width: 540px; }
.modal-lg .modal-body { padding: 32px 44px 38px; }
.modal-lg h2 { font-size: 2.1rem; margin-bottom: 30px; }
.modal-lg .field { margin-bottom: 16px; }
.modal-lg .field label { font-size: 0.95rem; margin-bottom: 9px; }
.modal-lg .field input { font-size: 1.08rem; padding: 16px 18px; border-radius: 10px; }
.modal-lg .remember { font-size: 0.95rem; margin: 8px 0 28px; }
.modal-lg .btn { font-size: 1.1rem; padding: 17px 24px; }
.modal-lg .link.small { font-size: 0.88rem; }
.modal-lg .modal-foot { padding: 22px 44px 24px; font-size: 0.98rem; }

.modal-text { color: #c9c3bb; line-height: 1.55; margin: -14px 0 24px; }

/* ---------- Form ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 7px; color: #d8d2ca; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }

.field input {
  width: 100%;
  font: 400 1rem var(--body);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}
.field input:hover { border-color: #4d4848; }
.field input:focus { border-color: var(--pink); }
.field input.invalid { border-color: var(--error); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font: 500 0.82rem var(--body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.toggle-pass:hover { color: var(--paper); }

.error { color: var(--error); font-size: 0.8rem; min-height: 1.1em; display: block; margin-top: 5px; }

.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #d8d2ca;
  cursor: pointer;
  margin: 4px 0 22px;
  user-select: none;
}
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--muted);
  border-radius: 4px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.remember input:checked + .box { background: var(--pink); border-color: var(--pink); }
.remember input:checked + .box::after {
  content: "";
  width: 5px; height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.remember input:focus-visible + .box { outline: 2px solid var(--pink); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  font: 600 1rem var(--body);
  border-radius: 10px;
  padding: 13px 24px;
  cursor: pointer;
  border: 2px solid var(--ink);
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--ink);
}
.btn-primary:hover { background: var(--pink-deep); border-color: var(--pink-deep); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover { background: #fff; }
.g-icon { width: 18px; height: 18px; }
.btn-outline { background: transparent; color: var(--pink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--pink); }
#openLogin { transition: transform 0.2s ease-out, border-color 0.15s; }
#openLogin:hover { transform: scale(1.06); }
#openLogin:active { transform: scale(1.02); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--paper); }
.btn-full { width: 100%; }
#loginForm .btn + .btn { margin-top: 12px; }

.link { color: var(--pink); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.small { font-size: 0.8rem; font-weight: 500; }

.prefix-wrap { position: relative; }
.prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.prefix-wrap input { padding-left: 32px; }

.hint-ok { color: #7ee2a8; }

.form-error {
  background: rgba(255, 45, 61, 0.1);
  border: 1.5px solid var(--error);
  color: var(--error);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 14px;
}

#signupForm .legal { margin-top: 12px; }

/* ---------- Signed-in view ---------- */
.signed-in { max-width: 320px; }
.signed-in-label { color: var(--muted); font-size: 0.9rem; }
.signed-in-name { font-family: var(--display); font-weight: 700; font-size: 1.6rem; margin-top: 6px; }
.signed-in-handle { color: var(--pink); margin: 2px 0 22px; }

/* ---------- Success ---------- */
.success { padding: 4px 0 8px; }
.success h3 { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.success p { color: var(--muted); margin-top: 6px; }

.shake { animation: shake 0.35s; }
@keyframes shake {
  0%, 100% { translate: 0; }
  25% { translate: -7px 0; }
  75% { translate: 7px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; align-content: start; gap: 40px; padding-top: 28px; }
  .home-logo { justify-content: flex-start; }
  .logo-big { font-size: clamp(3.4rem, 13vw, 4.4rem); }
  .logo-big .line { display: inline; }
  .logo-big .line + .line { margin: 0 0 0 0.22em; }
  .headline { font-size: clamp(2.4rem, 11vw, 3.4rem); margin-bottom: 32px; }
}

@media (max-width: 480px) {
  .modal-body { padding: 24px 20px 20px; }
  .modal-wrap { filter: drop-shadow(6px 6px 0 var(--pink)); }
}

/* ---------- Sleepy logo eyes ---------- */
.logo.asleep .eye { --close: 1; }
.logo.asleep .lid { transition-duration: 1.4s; transition-timing-function: ease-in; }
.logo.waking .eye { animation: eyeWake 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes eyeWake { 0% { transform: scale(0.9); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.zzz { position: absolute; left: 5.3em; top: -0.5em; pointer-events: none; font-family: var(--display, sans-serif); font-weight: 900; color: var(--pink); font-size: 0.32em; line-height: 1; }
.zzz i { position: absolute; font-style: normal; opacity: 0; }
.logo.asleep .zzz i { animation: zFloat 3s ease-in-out infinite; }
.logo.asleep .zzz i:nth-child(2) { animation-delay: 1s; font-size: 1.25em; }
.logo.asleep .zzz i:nth-child(3) { animation-delay: 2s; font-size: 1.55em; }
@keyframes zFloat {
  0% { opacity: 0; transform: translate(0, 0.4em) rotate(-10deg); }
  20% { opacity: 1; }
  80% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(1.4em, -1.6em) rotate(12deg); }
}
@media (prefers-reduced-motion: reduce) { .logo.asleep .zzz i { animation: none; opacity: 0.8; } }
.logo-big .line { white-space: nowrap; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
#loginCard .google-btn { margin: 6px 0 4px; }
.g-note { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2000; max-width: min(460px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: #1a1919; border: 1px solid var(--pink, #ff4fa3); color: #f5f0eb; font: 500 0.92rem "Golos Text", sans-serif; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }

/* ---------- Phones: a centred, balanced start page ---------- */
@media (max-width: 640px) {
  .home { min-height: calc(100dvh - 90px); display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 30px; padding: 32px 20px 24px !important; text-align: center; }
  .home-logo { justify-content: center !important; width: 100%; }
  .logo-big { font-size: clamp(3.6rem, 17vw, 4.8rem) !important; }
  .logo-big .line { display: block !important; }
  .logo-big .line + .line { margin: 0.02em 0 0 !important; }
  .home-cta { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: stretch; }
  .headline { font-size: clamp(2rem, 9.5vw, 2.6rem) !important; margin: 0 0 6px !important; line-height: 1.05; }
  .join { font-size: clamp(1.25rem, 6vw, 1.55rem) !important; margin: 0 0 22px !important; color: var(--muted); }
  .cta-buttons, .have-account { max-width: none !important; width: 100%; }
  .home-cta .btn { height: 52px; font-size: 1.02rem; border-radius: 999px; }
  .legal { font-size: 0.78rem; margin: 12px 4px 0; text-align: center; }
  .have-account { margin-top: 26px !important; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .have-account p { margin: 0 0 12px !important; font-size: 0.98rem; font-weight: 700; }
  .footer { justify-content: center; text-align: center; gap: 6px 14px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); font-size: 0.78rem; }
  /* the log-in / sign-up window fills the phone nicely */
  .modal-card { width: 100%; }
}
/* ---------- Phones: log in / sign up as a sheet from the bottom ---------- */
@media (max-width: 640px) {
  .overlay { align-items: flex-end !important; padding: 0 !important; }
  .overlay .modal-wrap { max-width: none; width: 100%; max-height: 94dvh; padding: 0; filter: none; transform: translateY(100%); opacity: 1; transition: transform 0.32s cubic-bezier(0.2, 1, 0.3, 1); }
  .overlay.open .modal-wrap { transform: translateY(0); }
  .overlay .modal-card { border-radius: 26px 26px 0 0; border: none; border-top: 3px solid var(--pink); box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.6); }
  .overlay .modal-body { padding: 14px 22px calc(22px + env(safe-area-inset-bottom)); }
  .overlay .modal-body::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); }
  .modal-card h2 { font-size: 1.7rem !important; line-height: 1.1; margin-bottom: 18px; }
  .modal-card .field input, .modal-card input[type="text"], .modal-card input[type="email"], .modal-card input[type="password"] { height: 50px; font-size: 16px; }
  .modal-card .btn { height: 52px; border-radius: 999px; font-size: 1.02rem; }
}
/* ---------- Phones: the big LookBlog logo stays on top while you log in / sign up ---------- */
@media (max-width: 640px) {
  body:has(.overlay.open) .home-logo { position: fixed; z-index: 101; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0; height: calc(100dvh - min(560px, 72dvh) - 24px); display: flex !important; align-items: center; justify-content: center; pointer-events: none; animation: logoUp 0.35s cubic-bezier(.2, 1, .3, 1); }
  body:has(.overlay.open) .logo-big { font-size: clamp(4rem, 21vw, 5.6rem) !important; line-height: 0.95; text-align: center; }
  body:has(.overlay.open) .home-cta { visibility: hidden; }
  .overlay .modal-wrap { max-height: min(560px, 72dvh) !important; }
  @keyframes logoUp { from { transform: translateY(30px) scale(0.9); opacity: 0.5; } }
}
@media (max-width: 640px) {
  .overlay.open { background: rgba(10, 9, 9, 0) !important; backdrop-filter: none !important; }
  body:has(.overlay.open) .footer { visibility: hidden; }
}
/* the LookBlog logo bigger than "Look around." on phones */
@media (max-width: 640px) {
  .logo-big { font-size: clamp(5rem, 27vw, 7rem) !important; line-height: 0.92; }
  .home { gap: 22px !important; }
  body:has(.overlay.open) .logo-big { font-size: clamp(5rem, 26vw, 6.6rem) !important; }
}
/* Signing up: confirm your age and the terms */
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 2px; cursor: pointer; font-size: 0.84rem; line-height: 1.45; color: var(--muted); text-align: left; }
.check-row input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--pink); }
.check-row input.invalid { outline: 2px solid #ff4757; outline-offset: 2px; }
.check-row a { color: var(--pink); text-decoration: none; }
.check-row b { color: var(--paper, #f5f0eb); }
.modal-text.small { font-size: 0.8rem; }

/* Show / hide password: the eyes react */
.logo.squeeze .eye { --close: 1; animation: eyeSqueeze 0.55s cubic-bezier(0.3, 1.4, 0.5, 1); }
.logo.squeeze .lid { transition-duration: 0.12s; }
@keyframes eyeSqueeze {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.1, 0.78); }
  60% { transform: scale(0.95, 1.06); }
  100% { transform: scale(1, 1); }
}
.logo.surprise .eye { animation: eyeSurprise 0.55s ease-out; }
.logo.surprise .lid { transition-duration: 0.18s; }
@keyframes eyeSurprise {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .logo.squeeze .eye, .logo.surprise .eye { animation: none; } }
