@import url("./design-tokens.css");

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/newsreader-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Newsreader Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/newsreader-latin-wght-italic.woff2") format("woff2-variations");
}

:root {
  color: var(--ink);
  background: #f4dcda;
  font-family: var(--sans);
  font-synthesis: none;
}

html[lang="ja"] {
  font-family: "Noto Sans JP Variable", "Yu Gothic UI", "Yu Gothic", sans-serif;
  --sans: "Noto Sans JP Variable", "Yu Gothic UI", "Yu Gothic", sans-serif;
  --serif: "Noto Serif JP Variable", "Yu Mincho", serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: #f4dcda;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8px 9px, rgba(185, 70, 92, 0.055) 0 1px, transparent 1.25px) 0 0 / 24px 24px,
    linear-gradient(180deg, #f4dcda 0, #f7e5e1 52%, #f4dcda 100%);
  font-family: var(--sans);
  letter-spacing: 0;
}

img { max-width: 100%; }

a {
  color: #0e61a6;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover { color: var(--orange); }

a:focus-visible {
  outline: 3px solid rgba(40, 169, 215, 0.42);
  outline-offset: 3px;
}

::selection {
  color: var(--ink);
  background: var(--yellow);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(45, 33, 31, 0.1);
  padding: max(7px, env(safe-area-inset-top)) max(16px, calc((100vw - 860px) / 2));
  background:
    radial-gradient(circle at 92% 30%, rgba(182, 216, 75, 0.18) 0 4px, transparent 4.5px),
    rgba(255, 245, 241, 0.96);
  box-shadow: 0 7px 22px rgba(86, 48, 43, 0.08);
  backdrop-filter: blur(18px);
}

.topbar > a:first-child {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  order: 2;
  border: 1px solid rgba(45, 33, 31, 0.2);
  border-radius: 14px 11px 15px 12px;
  padding: 9px 13px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 3px 0 rgba(45, 33, 31, 0.1);
  font-size: 12px;
  font-weight: 790;
  line-height: 1.2;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.topbar > a:first-child:hover {
  color: var(--ink);
  background: var(--rose);
  box-shadow: 2px 4px 0 rgba(244, 140, 151, 0.34);
  transform: translateY(-1px);
}

.app-brand {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  order: 1;
  color: var(--ink);
  text-decoration: none;
}

.app-brand:hover { color: var(--ink); }

.app-brand img {
  width: 52px;
  height: 52px;
  display: block;
  border-radius: 15px;
  object-fit: cover;
  filter: drop-shadow(2px 3px 0 rgba(40, 169, 215, 0.2));
}

.app-brand span {
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  font-weight: 650;
  line-height: 1;
}

.main {
  position: relative;
  width: min(calc(100% - 32px), 820px);
  margin: 34px auto 72px;
  border: 1.5px solid rgba(45, 33, 31, 0.62);
  border-radius: 29px 23px 31px 25px;
  padding: clamp(24px, 5vw, 50px);
  background:
    radial-gradient(circle at 94% 7%, rgba(40, 169, 215, 0.12) 0 54px, transparent 55px),
    radial-gradient(circle at 7% 29%, rgba(182, 216, 75, 0.12) 0 32px, transparent 33px),
    var(--white);
  box-shadow: 9px 10px 0 #e7beba, -4px -4px 0 rgba(223, 244, 247, 0.9);
}

.main::before {
  width: min(100%, 390px);
  aspect-ratio: 1200 / 450;
  display: block;
  margin: -8px 0 12px auto;
  background: url("/media/minds-feed-curiosity-stickers.png") center / contain no-repeat;
  filter: drop-shadow(2px 3px 0 rgba(45, 33, 31, 0.11));
  content: "";
}

.eyebrow {
  width: fit-content;
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 6px 10px 5px;
  color: var(--white);
  background: var(--berry);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 10px;
  font-weight: 830;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.main h1 {
  max-width: 690px;
  margin: 16px 0 8px;
  font-family: var(--serif);
  font-size: clamp(42px, 7.3vw, 64px);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-wrap: balance;
}

.updated {
  width: fit-content;
  margin: 15px 0 31px;
  border: 1px solid rgba(45, 33, 31, 0.52);
  border-radius: 9px 12px 8px 11px;
  padding: 7px 10px 6px;
  color: #76571b !important;
  background: var(--yellow);
  box-shadow: 2px 3px 0 rgba(45, 33, 31, 0.13);
  font-size: 10px !important;
  font-weight: 780;
  line-height: 1.25 !important;
  transform: rotate(0.75deg);
}

.main > h1 + p:not(.updated),
.main > .updated + p {
  max-width: 680px;
  margin: 0 0 31px;
  border-left: 4px solid var(--blue);
  padding: 3px 0 3px 15px;
  color: #493d3a;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 440;
  line-height: 1.5;
  text-wrap: pretty;
}

.main h2 {
  width: fit-content;
  max-width: 100%;
  margin: 38px 0 14px;
  border: 1px solid rgba(45, 33, 31, 0.64);
  border-radius: 11px 14px 10px 13px;
  padding: 8px 12px 7px;
  background: var(--rose);
  box-shadow: 3px 3px 0 rgba(45, 33, 31, 0.14);
  font-family: var(--serif);
  font-size: clamp(24px, 4.6vw, 31px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.03;
  text-wrap: balance;
  transform: rotate(-0.45deg);
}

.main h2:nth-of-type(4n + 2) {
  background: var(--sky);
  transform: rotate(0.45deg);
}

.main h2:nth-of-type(4n + 3) {
  background: var(--yellow);
  transform: rotate(-0.25deg);
}

.main h2:nth-of-type(4n + 4) {
  background: #e7f2b9;
  transform: rotate(0.35deg);
}

.main p,
.main li {
  color: #594b48;
  font-size: 14px;
  line-height: 1.76;
}

.main p {
  max-width: 72ch;
  margin: 0 0 15px;
  text-wrap: pretty;
}

.main strong { color: var(--ink); }

.main ul {
  max-width: 730px;
  margin: 15px 0 24px;
  border: 1px solid rgba(45, 33, 31, 0.26);
  border-radius: 18px 15px 20px 16px;
  padding: 17px 21px 17px 39px;
  background: linear-gradient(135deg, rgba(223, 244, 247, 0.72), var(--white) 68%);
  box-shadow: 4px 5px 0 rgba(40, 169, 215, 0.2);
}

.main li::marker { color: var(--orange); }
.main li + li { margin-top: 8px; }

.callout {
  max-width: 730px;
  margin: 26px 0 31px;
  border: 1.5px solid rgba(45, 33, 31, 0.54);
  border-left: 6px solid var(--blue);
  border-radius: 19px 15px 21px 16px;
  padding: 19px clamp(16px, 3.5vw, 25px);
  background:
    radial-gradient(circle at 95% 12%, rgba(182, 216, 75, 0.24) 0 34px, transparent 35px),
    var(--sky);
  box-shadow: 5px 6px 0 var(--rose);
}

.callout h2 {
  margin: 0 0 12px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(25px, 4.6vw, 32px);
  transform: none;
}

.callout p:last-child { margin-bottom: 0; }

.contact-email {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(45, 33, 31, 0.55);
  border-radius: 12px 10px 13px 11px;
  padding: 8px 11px;
  color: var(--ink) !important;
  background: var(--white);
  box-shadow: 3px 4px 0 rgba(40, 169, 215, 0.24);
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 820;
  overflow-wrap: anywhere;
  text-decoration-color: var(--blue);
}

.action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  border: 1px solid var(--ink);
  border-radius: var(--control-radius);
  padding: 11px 16px;
  color: var(--white) !important;
  background: var(--ink);
  box-shadow: 4px 5px 0 var(--coral);
  font-size: 12px;
  font-weight: 790;
  line-height: 1.2;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.action:hover {
  color: var(--ink) !important;
  background: var(--yellow);
  box-shadow: 5px 6px 0 var(--blue);
  transform: translateY(-1px);
}

.footer {
  display: grid;
  justify-items: center;
  gap: 20px;
  border-top: 1px solid rgba(45, 33, 31, 0.14);
  padding: 30px 20px calc(32px + env(safe-area-inset-bottom));
  background: rgba(255, 245, 241, 0.72);
}

.footer nav {
  max-width: 760px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.footer nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(45, 33, 31, 0.18);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: var(--white);
  font-size: 10px;
  font-weight: 760;
  text-decoration: none;
}

.footer nav a:nth-child(4n + 1) { background: var(--rose); }
.footer nav a:nth-child(4n + 2) { background: var(--sky); }
.footer nav a:nth-child(4n + 3) { background: #edf6ca; }
.footer nav a:nth-child(4n + 4) { background: #fff0ba; }
.footer nav a:hover { color: var(--ink); border-color: rgba(45, 33, 31, 0.42); }

.powered-by {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.powered-by a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  line-height: 0;
  transition: opacity 150ms ease;
}

.powered-by a:hover { opacity: 0.78; }

.powered-by img {
  width: 82px;
  height: 34px;
  object-fit: contain;
}

@media (min-width: 760px) {
  .main { margin-top: 46px; }

  .main::before {
    width: 360px;
    margin-top: -20px;
    margin-bottom: -2px;
  }
}

@media (max-width: 520px) {
  .topbar { min-height: 70px; padding-inline: 12px; }
  .topbar > a:first-child { max-width: 145px; padding-inline: 11px; font-size: 10px; text-align: center; }
  .app-brand img { width: 49px; height: 49px; }
  .main { width: calc(100% - 24px); margin: 25px auto 55px; padding: 23px 18px 30px; box-shadow: 6px 7px 0 #e7beba, -3px -3px 0 rgba(223, 244, 247, 0.9); }
  .main::before { margin-top: -3px; margin-bottom: 14px; }
  .main h1 { font-size: clamp(39px, 13vw, 54px); }
  .main > h1 + p:not(.updated), .main > .updated + p { font-size: 16px; }
  .main h2 { margin-top: 34px; }
  .main p, .main li { font-size: 13px; }
  .main ul { padding: 15px 16px 15px 32px; }
  .callout { margin-inline: -2px; padding: 17px 15px; }
}

@media (max-width: 380px) {
  .app-brand span { display: none; }
  .topbar > a:first-child { max-width: 188px; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar > a:first-child,
  .action { transition: none; }
}

@media print {
  html, body { background: white; }
  .topbar, .footer, .main::before { display: none; }
  .main { width: 100%; margin: 0; border: 0; padding: 0; background: white; box-shadow: none; }
  .eyebrow, .updated, .main h2 { color: var(--ink); background: white; box-shadow: none; transform: none; }
  .main p, .main li { color: #222; }
}
