:root {
  --rf-ink: #171823;
  --rf-muted: #686b7a;
  --rf-line: #e8e7ef;
  --rf-violet: #6849f6;
  --rf-blue: #3478f6;
  --rf-coral: #ff7181;
  --rf-mint: #29c98c;
  --rf-wash: #f7f5ff;
  --rf-radius: 22px;
  --rf-shadow: 0 18px 48px rgba(32, 28, 72, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.refresh {
  background: #fff;
  color: var(--rf-ink);
  text-rendering: optimizeLegibility;
}
body.refresh .wrap { width: min(1180px, calc(100% - 40px)); }
body.refresh header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(31, 28, 55, .07);
  backdrop-filter: blur(18px);
}
body.refresh .nav { min-height: 68px; }
body.refresh .brand { letter-spacing: -.035em; }
body.refresh .navlink { font-weight: 650; }

/* Creator canvas hero */
body.refresh-home .hero-wrap {
  overflow: visible;
  padding: 64px 0 34px;
  background:
    radial-gradient(circle at 17% 25%, rgba(204, 185, 255, .52), transparent 35%),
    radial-gradient(circle at 88% 30%, rgba(255, 201, 190, .58), transparent 31%),
    linear-gradient(118deg, #fbf9ff 0%, #f5f0ff 48%, #fff7f3 100%);
}
body.refresh-home .hero {
  display: grid !important;
  grid-template-columns: minmax(0, .92fr) minmax(440px, 1.08fr);
  align-items: center;
  gap: 58px;
  min-height: 470px;
  max-width: none !important;
  padding: 0 !important;
}
body.refresh-home .hero-copy { max-width: 590px; }
body.refresh-home .hero h1 {
  max-width: 590px;
  margin: 0 0 22px;
  font-size: clamp(46px, 5.1vw, 72px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.065em !important;
}
body.refresh-home .hero h1 em {
  color: var(--rf-violet) !important;
  background: none !important;
  box-shadow: none;
  font-style: normal;
  padding: 0 !important;
}
body.refresh-home .hero .lead {
  max-width: 560px;
  color: #464958;
  font-size: 18px;
  line-height: 1.75;
}
body.refresh-home .badges { gap: 10px; }
body.refresh-home .badges span {
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(99, 73, 224, .11);
  box-shadow: 0 8px 24px rgba(50, 39, 98, .06);
}
.refresh-hero-visual {
  position: relative;
  min-height: 430px;
  isolation: isolate;
}
.refresh-hero-visual::before,
.refresh-hero-visual::after {
  content: "";
  position: absolute;
  border-radius: 36px;
  transform: rotate(-4deg);
  inset: 58px 28px 30px 56px;
  background: #d7ccff;
  z-index: -2;
}
.refresh-hero-visual::after {
  inset: 88px -4px 0 90px;
  transform: rotate(5deg);
  background: #ffb4bd;
  z-index: -3;
}
.refresh-canvas {
  position: absolute;
  inset: 28px 34px 30px 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 32px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 30px 70px rgba(75, 52, 144, .2);
  backdrop-filter: blur(12px);
}
.refresh-canvas > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}
.refresh-canvas .crop-grid {
  position: absolute;
  inset: 75px 75px 74px 82px;
  border: 2px solid #fff;
  background:
    linear-gradient(90deg, transparent 33%, rgba(255,255,255,.76) 33% 33.5%, transparent 33.5% 66%, rgba(255,255,255,.76) 66% 66.5%, transparent 66.5%),
    linear-gradient(transparent 33%, rgba(255,255,255,.76) 33% 33.5%, transparent 33.5% 66%, rgba(255,255,255,.76) 66% 66.5%, transparent 66.5%);
}
.refresh-output {
  position: absolute;
  right: -12px;
  width: 150px;
  padding: 10px;
  border: 1px solid rgba(35, 31, 61, .09);
  border-radius: 18px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 16px 34px rgba(43, 34, 88, .16);
}
.refresh-output.one { top: 52px; }
.refresh-output.two { bottom: 44px; right: -22px; }
.refresh-output img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 11px; }
.refresh-output span { display: block; margin: 6px 2px 0; color: #4d5060; font-size: 11px; font-weight: 750; }

.refresh-search-shell {
  position: relative;
  z-index: 8;
  width: min(1120px, calc(100% - 40px));
  margin: -4px auto 46px;
  padding: 22px;
  border: 1px solid rgba(49, 41, 83, .08);
  border-radius: 26px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--rf-shadow);
}
.refresh-search {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 74px;
  padding: 0 12px 0 24px;
  border: 1px solid #ddd9eb;
  border-radius: 20px;
  background: #fff;
}
.refresh-search svg { width: 27px; color: #1e2230; }
.refresh-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rf-ink);
  font: inherit;
  font-size: 18px;
}
.refresh-search button {
  width: 54px;
  height: 50px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--rf-violet), var(--rf-blue));
  color: #fff;
  font-size: 27px;
  cursor: pointer;
}
.refresh-search-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 15px; }
.refresh-search-chips button {
  padding: 8px 14px;
  border: 1px solid #e6e3ee;
  border-radius: 999px;
  background: #fff;
  color: #454958;
  cursor: pointer;
  font-weight: 650;
}

/* Rich tool cards */
body.refresh .grid { gap: 18px; }
body.refresh .tool-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid var(--rf-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(32, 28, 72, .055);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
body.refresh .tool-card:hover {
  transform: translateY(-4px);
  border-color: #d8d1fb;
  box-shadow: 0 18px 38px rgba(57, 43, 113, .11);
}
.refresh-card-media {
  order: 3;
  width: 100%;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--rf-wash);
}
.refresh-card-media img { display: block; width: 100%; aspect-ratio: 12/7; object-fit: cover; }
body.refresh-home .grid .tool-card { display: grid; grid-template-columns: auto 1fr; align-content: start; }
body.refresh-home .grid .tool-card .refresh-card-media { grid-column: 1 / -1; }
body.refresh-home .hero-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 12px;
}
body.refresh-home .hero-bento .ht {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(32, 28, 72, .07);
}
body.refresh-home .hero-bento .ht.big { grid-column: auto; grid-row: auto; }
body.refresh-home .hero-bento .refresh-card-media { margin-top: auto; }

body.refresh .b-card { overflow: hidden; border-radius: 22px; }
.refresh-bento-media { width: 100%; margin-top: 16px; overflow: hidden; border-radius: 16px; }
.refresh-bento-media img { display: block; width: 100%; aspect-ratio: 16/8; object-fit: cover; }

/* Tool page visuals */
body.refresh-tool .tool-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 42px;
  align-items: center;
  padding-top: 52px;
}
.refresh-tool-cover {
  grid-column: 2;
  grid-row: 1 / span 4;
  overflow: hidden;
  border: 1px solid var(--rf-line);
  border-radius: 24px;
  background: var(--rf-wash);
  box-shadow: var(--rf-shadow);
}
.refresh-tool-cover img { display: block; width: 100%; aspect-ratio: 12/7; object-fit: cover; }
body.refresh-tool .app {
  border: 1px solid #e5e1ef;
  border-radius: 26px;
  box-shadow: var(--rf-shadow);
}
.refresh-tool-storyboard {
  width: min(1180px, calc(100% - 40px));
  margin: 48px auto;
}
.refresh-tool-storyboard h2 { margin-bottom: 8px; font-size: 30px; }
.refresh-tool-storyboard > p { color: var(--rf-muted); }
.refresh-story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.refresh-story-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rf-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(32,28,72,.06);
}
.refresh-story-grid img { display: block; width: 100%; aspect-ratio: 8/5; object-fit: cover; }
.refresh-story-grid figcaption { padding: 16px 18px 18px; font-weight: 750; }
body.refresh-tool article.content { max-width: 880px; }
body.refresh-tool article.content h2 { margin-top: 2.2em; letter-spacing: -.025em; }
body.refresh-tool .related .tool-card { display: grid; }
.refresh-related-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 54px;
  margin-bottom: 54px;
}
.refresh-related-nav a {
  padding: 16px 18px;
  border: 1px solid var(--rf-line);
  border-radius: 15px;
  background: var(--rf-wash);
  color: var(--rf-ink);
  font-weight: 750;
  text-align: center;
}

/* Articles */
body.refresh-articles .ai-head { padding-top: 64px; }
.refresh-article-search { margin: 28px 0 36px; }
body.refresh-articles .art-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
body.refresh .art-card {
  overflow: hidden;
  border: 1px solid var(--rf-line);
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32,28,72,.055);
  transition: transform .2s ease, box-shadow .2s ease;
}
body.refresh .art-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(45,36,92,.11); }
.refresh-article-media { margin: -1px -1px 16px; overflow: hidden; }
.refresh-article-media img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
body.refresh-article .article-main { max-width: 1120px; }
body.refresh-article .article-main > h1 { max-width: 940px; letter-spacing: -.045em; }
.refresh-article-hero {
  margin: 28px 0 44px;
  overflow: hidden;
  border-radius: 26px;
  box-shadow: var(--rf-shadow);
}
.refresh-article-hero img { display: block; width: 100%; aspect-ratio: 16/8; object-fit: cover; }
body.refresh-article .article-body { max-width: 780px; margin-left: auto; margin-right: auto; }
.refresh-inline-figure { margin: 42px -70px; }
.refresh-inline-figure img { display: block; width: 100%; border-radius: 22px; box-shadow: var(--rf-shadow); }
.refresh-inline-figure figcaption { margin-top: 10px; color: var(--rf-muted); font-size: 14px; text-align: center; }

body.refresh footer.site { margin-top: 60px; background: #15172a; color: #d7d8e4; }
body.refresh footer.site a { color: #e7e8f2; }
body.refresh footer.site .copy,
body.refresh footer.site .foot-family { border-color: rgba(255,255,255,.1); }

[data-theme="dark"] body.refresh { --rf-ink: #f2f3f8; --rf-muted: #aeb1c0; --rf-line: #303348; background: #10111b; }
[data-theme="dark"] body.refresh header.site { background: rgba(16,17,27,.88); }
[data-theme="dark"] body.refresh .tool-card,
[data-theme="dark"] body.refresh .art-card,
[data-theme="dark"] .refresh-search-shell,
[data-theme="dark"] .refresh-search { background: #181a27; }

@media (max-width: 980px) {
  body.refresh-home .hero { grid-template-columns: 1fr; gap: 18px; }
  body.refresh-home .hero-copy { max-width: 720px; }
  .refresh-hero-visual { min-height: 390px; }
  body.refresh-home .hero-bento { grid-template-columns: repeat(2, 1fr); }
  body.refresh-tool .tool-head { grid-template-columns: 1fr; }
  .refresh-tool-cover { grid-column: 1; grid-row: auto; max-width: 680px; }
  body.refresh-articles .art-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  body.refresh .wrap { width: min(100% - 24px, 1180px); }
  body.refresh-home .hero-wrap { padding-top: 34px; }
  body.refresh-home .hero h1 { font-size: clamp(40px, 12vw, 58px); }
  body.refresh-home .hero .lead { font-size: 16px; }
  .refresh-hero-visual { min-height: 320px; }
  .refresh-canvas { inset: 22px 24px 22px 0; }
  .refresh-canvas .crop-grid { inset: 60px 55px; }
  .refresh-output { width: 112px; right: -5px; }
  .refresh-output.two { right: -8px; }
  .refresh-search-shell { width: calc(100% - 24px); margin-top: 4px; padding: 12px; }
  .refresh-search { height: 62px; padding-left: 16px; }
  .refresh-search input { font-size: 15px; }
  body.refresh-home .hero-bento,
  .refresh-story-grid,
  body.refresh-articles .art-list,
  .refresh-related-nav { grid-template-columns: 1fr; }
  body.refresh-home .hero-bento .ht { min-height: 280px; }
  .refresh-inline-figure { margin: 32px 0; }
  body.refresh-tool .tool-head { padding-top: 32px; }
}
