/* joelrieger.com/cosmos — split hero newsletter */

@font-face {
  font-family: "Diatype Mono";
  src: url("./assets/fonts/DiatypeMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Exposure";
  src: url("./assets/fonts/ExposureTrial-50.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body.cosmosBody {
  overflow: hidden;
}

.cosmos {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  max-height: 100vh;
  max-height: 100dvh;
}

.cosmos__panel {
  width: 50vw;
  flex: 0 0 50vw;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.cosmos__panel--left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cosmos__panel--right {
  background: #111;
}

.cosmos__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  z-index: 0;
}

.cosmos__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Painting behind is busy — a soft dark veil keeps type and form fields legible. */
  background: linear-gradient(100deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.22) 55%, rgba(0, 0, 0, 0.05) 100%);
  overflow-y: auto;
  padding: 80px 48px 40px 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65), 0 0 24px rgba(0, 0, 0, 0.35);
}

.cosmos__nav {
  position: absolute;
  top: 28px;
  right: 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: none;
}

.cosmos__nav a {
  color: #fff;
  text-decoration: none;
}

.cosmos__nav a:hover {
  text-decoration: underline;
}

.cosmos__nav a.is-accent {
  color: #7ec8ff;
}

.cosmos__logo {
  display: block;
  line-height: 0;
  margin-bottom: 2rem;
}

.cosmos__logo img {
  display: block;
  height: 48px;
  width: auto;
  /* Black mark on a dark panel was invisible — invert to white, hue-rotate keeps the yellow/blue accents. */
  filter: invert(1) hue-rotate(180deg) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.cosmos__headline {
  font-family: "Diatype Mono", ui-monospace, "Courier New", monospace;
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 72px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
  max-width: 14ch;
  text-wrap: balance;
}

.cosmos__body {
  font-family: "Exposure", "Times New Roman", Times, serif;
  font-size: clamp(15px, 1.65vw, 22px);
  line-height: 1.35;
  font-style: italic;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
  max-width: 22ch;
  text-wrap: balance;
}

.cosmos__social {
  font-family: "Exposure", "Times New Roman", Times, serif;
  font-size: 14px;
  line-height: 1.4;
  font-style: italic;
  margin: 0 0 1.25rem;
  opacity: 0.95;
}

.cosmos__formWrap {
  margin: 0 0 1rem;
}

.cosmos__fineprint {
  font-family: "Exposure", "Times New Roman", Times, serif;
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1.5rem;
  max-width: 320px;
}

.cosmos__icons {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cosmos__icons a {
  color: #fff;
  opacity: 0.95;
  line-height: 0;
}

.cosmos__icons svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Kit form: no radius / shadow on this page */
.cosmos__formWrap .formkit-form[data-uid="37b9f7fa34"] .formkit-input,
.cosmos__formWrap .formkit-form[data-uid="37b9f7fa34"] .formkit-submit {
  border-radius: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  body.cosmosBody {
    overflow-y: auto;
  }

  .cosmos {
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: 100vh;
  }

  .cosmos__panel {
    width: 100%;
    flex: 0 0 auto;
    min-height: 42vh;
    height: 42vh;
  }

  /* Newsletter first on phones — the headline + form are why people land here;
     the studio photo follows as a banner below. */
  .cosmos__panel--right {
    order: -1;
    min-height: 0;
    height: auto;
  }

  .cosmos__panel--left {
    min-height: 0;
    height: 56vh;
  }

  .cosmos__overlay {
    position: relative;
    padding: 24px 24px 40px;
    min-height: 100vh;
    min-height: 100svh;
    overflow: visible;
    background: rgba(0, 0, 0, 0.45);
  }

  .cosmos__nav {
    position: static;
    justify-content: flex-start;
    margin-bottom: 2rem;
    gap: 20px;
  }

  .cosmos__headline {
    font-size: clamp(24px, 7vw, 40px);
    max-width: none;
  }

  .cosmos__body {
    max-width: 30ch;
  }
}

/* Extra fonts offered in the admin's Cosmos builder (cosmos-builder.js FONTS). */
@font-face {
  font-family: "Monument Grotesk";
  src: url("./fonts/ABCMonumentGrotesk-Regular-Trial.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Monument Grotesk";
  src: url("./fonts/ABCMonumentGrotesk-Bold-Trial.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("./fonts/EBGaramond-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("./fonts/EBGaramond-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

.cosmos__custom {
  margin: 0 0 1rem;
  white-space: normal;
}

/* ── Edit mode (admin preview iframe, ?edit=1) ── */
html.cosmos-edit [data-el] {
  cursor: move;
  outline: 1px dashed transparent;
  outline-offset: 4px;
  user-select: none;
}
html.cosmos-edit [data-el]:hover {
  outline-color: rgba(126, 200, 255, 0.7);
}
html.cosmos-edit [data-el].is-selected {
  outline: 1px solid #7ec8ff;
}
html.cosmos-edit [data-el][contenteditable="true"] {
  cursor: text;
  user-select: text;
  outline: 2px solid #7ec8ff;
}
html.cosmos-edit .cosmos__formWrap * {
  pointer-events: none;
}
.cosmos-resize {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 12px;
  height: 12px;
  background: #7ec8ff;
  border: 1px solid #fff;
  cursor: nwse-resize;
  z-index: 5;
}
html.cosmos-edit [data-el].is-selected {
  position: relative;
}
html.cosmos-edit [data-el="nav"].is-selected {
  position: absolute;
}
.cosmos-guide {
  display: none;
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: #ff3df0;
}
.cosmos-guide--v {
  top: 0;
  bottom: 0;
  width: 1px;
}
.cosmos-guide--h {
  left: 0;
  right: 0;
  height: 1px;
}
html.cosmos-edit .cosmos__formWrap .cosmos-resize {
  pointer-events: auto;
}
