
/* Keep the content column in exactly the same horizontal position on every page. */
html {
  overflow-y: scroll;
}


:root{
  --bg:#f7f7f8;
  --surface:#ffffff;
  --text:#17181a;
  --muted:#666a70;
  --line:#e5e6e8;
  --accent:#111827;
  --max:1120px;
  --reading:820px;
  --radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  line-height:1.65;
}
a{color:inherit}
.site-header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(247,247,248,.92);
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(0,0,0,.07);
}
.header-inner{
  max-width:var(--max);
  margin:0 auto;
  min-height:72px;
  padding:0 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.brand{
  text-decoration:none;
  font-weight:850;
  font-size:20px;
  letter-spacing:-.03em;
}
.site-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:6px;
}
.site-nav a{
  text-decoration:none;
  font-size:14px;
  font-weight:650;
  color:#555a61;
  padding:8px 11px;
  border-radius:10px;
}
.site-nav a:hover{background:#e9eaec;color:#111}
.page-shell{
  width:100%;
}
.hero{
  max-width:var(--max);
  margin:0 auto;
  padding:72px 24px 42px;
}
.hero-inner{
  max-width:900px;
}
.hero h1{
  margin:0 0 16px;
  font-size:clamp(42px,7vw,76px);
  line-height:.98;
  letter-spacing:-.055em;
}
.hero p{
  max-width:720px;
  margin:0;
  color:var(--muted);
  font-size:18px;
}
.tools-section{
  max-width:var(--max);
  margin:0 auto;
  padding:20px 24px 60px;
}
.tools-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.tool-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:0 8px 30px rgba(0,0,0,.035);
}
.tool-card h2,.tool-card h3{margin-top:0}
input,select,button{
  font:inherit;
}
input,select{
  width:100%;
  border:1px solid #d7d9dc;
  background:#fff;
  border-radius:11px;
  padding:11px 12px;
}
button{
  border:0;
  border-radius:11px;
  padding:11px 14px;
  cursor:pointer;
}
.content-section{
  width:100%;
  border-top:1px solid var(--line);
  background:#fff;
  padding:72px 24px;
}
.content-section .content-wrap{
  max-width:var(--reading);
  margin:0 auto;
}
.content-section h2{
  font-size:clamp(30px,5vw,46px);
  line-height:1.08;
  letter-spacing:-.035em;
  margin:0 0 20px;
}
.content-section h3{
  font-size:22px;
  line-height:1.25;
  margin:38px 0 9px;
}
.content-section p{
  margin:0 0 14px;
  color:#575b61;
  font-size:16px;
}
.page-content{
  max-width:var(--reading);
  margin:0 auto;
  padding:64px 24px 80px;
}
.page-content h1{
  margin:0 0 26px;
  font-size:clamp(38px,6vw,60px);
  line-height:1;
  letter-spacing:-.045em;
}
.page-content h2{
  margin:38px 0 10px;
  font-size:25px;
  line-height:1.2;
}
.page-content p{color:#575b61}

/* Contact form */
.contact-form{margin-top:30px}
.contact-form form{display:grid;gap:10px}
.contact-form label{font-weight:700;margin-top:8px}
.contact-form input,.contact-form textarea{display:block;width:100%;box-sizing:border-box;border:1px solid #d5d7db;border-radius:12px;background:#fff;padding:14px 15px;font:inherit;color:#111;resize:vertical}
.contact-form textarea{min-height:190px;line-height:1.5}
.contact-form button{justify-self:start;margin-top:8px;border:0;border-radius:12px;padding:13px 18px;background:#111;color:#fff;font:inherit;font-weight:700;cursor:pointer}
.contact-form button:hover{opacity:.82}
.contact-form #formStatus{margin:6px 0 0}

.site-footer{
  border-top:1px solid var(--line);
  background:#f7f7f8;
}
.footer-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:30px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
}
.footer-links{
  display:flex;
  gap:8px 16px;
  flex-wrap:wrap;
}
.footer-links a{
  color:#5d6167;
  font-size:13px;
  text-decoration:none;
}
.footer-note{
  color:#777b81;
  font-size:12px;
}
.preset{
  margin-top:12px;
}
@media(max-width:760px){
  .header-inner{
    min-height:auto;
    padding:12px 16px;
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
  }
  .site-nav{
    width:100%;
    justify-content:flex-start;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-bottom:2px;
  }
  .site-nav a{white-space:nowrap}
  .hero{padding:48px 18px 28px}
  .tools-section{padding:14px 18px 42px}
  .tools-grid{grid-template-columns:1fr}
  .content-section{padding:52px 18px}
  .page-content{padding:48px 18px 64px}
  .footer-inner{padding:26px 18px}
}


/* Desktop content boundary: keep the whole site comfortably centered. */
:root{--site-width:900px}
.header-inner,.hero,.tools,.tools-section,.page-content,.footer-inner{
  max-width:var(--site-width);
  margin-left:auto;
  margin-right:auto;
}
.hero{
  padding-left:20px;
  padding-right:20px;
  background:#fff;
}
.tools{
  padding-left:20px;
  padding-right:20px;
}
.content-section{
  padding-left:20px;
  padding-right:20px;
}
.content-section .content-wrap{
  max-width:820px;
}
.site-footer .footer-inner{
  padding-left:20px;
  padding-right:20px;
}
@media(max-width:940px){
  .header-inner,.hero,.tools,.tools-section,.page-content,.footer-inner{
    max-width:100%;
  }
}


/* Calculator pages/views use the same centered site boundary as the landing page. */
.view{
  max-width:900px;
  width:100%;
  margin:0 auto;
  padding:48px 20px 76px;
  min-height:620px;
}
.view .panel{
  width:100%;
  max-width:100%;
}
.view .result{
  width:100%;
}
@media(max-width:940px){
  .view{max-width:100%;padding-left:20px;padding-right:20px}
}

.color-tool{
  display:grid;
  grid-template-columns:minmax(220px,300px) 1fr;
  gap:28px;
  align-items:center;
}
.color-wheel-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
}
.color-wheel{
  position:relative;
  width:min(270px,72vw);
  aspect-ratio:1;
  border-radius:50%;
  background:
    conic-gradient(
      hsl(0 100% 50%),
      hsl(30 100% 50%),
      hsl(60 100% 50%),
      hsl(90 100% 50%),
      hsl(120 100% 50%),
      hsl(150 100% 50%),
      hsl(180 100% 50%),
      hsl(210 100% 50%),
      hsl(240 100% 50%),
      hsl(270 100% 50%),
      hsl(300 100% 50%),
      hsl(330 100% 50%),
      hsl(360 100% 50%)
    );
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 8px 24px rgba(0,0,0,.08);
  cursor:crosshair;
  touch-action:none;
}
.color-wheel::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:radial-gradient(circle,#fff 0 0%,transparent 70%);
  pointer-events:none;
}
.color-wheel-marker{
  position:absolute;
  width:18px;
  height:18px;
  border-radius:50%;
  border:3px solid #fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.45),0 2px 6px rgba(0,0,0,.2);
  transform:translate(-50%,-50%);
  z-index:2;
  pointer-events:none;
}
.color-preview{
  height:74px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.12);
  margin:12px 0 16px;
}
.color-values{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
}
.color-value{
  background:#f7f7f8;
  border:1px solid #e5e6e8;
  border-radius:11px;
  padding:10px;
}
.color-value small{
  display:block;
  color:#777;
  font-size:11px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.color-value strong{
  font-size:15px;
}
@media(max-width:680px){
  .color-tool{grid-template-columns:1fr}
  .color-wheel{width:min(260px,78vw)}
  .color-values{grid-template-columns:1fr}
}


/* Aspect ratio controls */
.ratio-controls{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}
.ratio-slider-card{
  background:#f7f7f8;
  border:1px solid #e5e6e8;
  border-radius:14px;
  padding:14px 16px 13px;
}
.ratio-slider-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:9px;
}
.ratio-slider-head label{
  font-size:13px;
  font-weight:750;
}
.ratio-slider-head strong{
  font-size:20px;
  letter-spacing:-.02em;
  color:#4f42b9;
}
.ratio-slider-card input[type=range]{
  width:100%;
  accent-color:#6c5ce7;
}
.ratio-lock{
  display:flex;
  align-items:center;
  gap:9px;
  width:max-content;
  margin:4px 0 16px;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.ratio-lock input{
  width:18px;
  height:18px;
  margin:0;
  accent-color:#6c5ce7;
}
.ratio-dimensions{
  margin-top:2px;
}
@media(max-width:700px){
  .ratio-controls{grid-template-columns:1fr}
}

/* Result visualizations */
.visual{
  margin-top:18px;
  background:#f7f7f8;
  border:1px solid #e5e6e8;
  border-radius:16px;
  padding:18px;
}
.viz-title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.09em;
  font-weight:850;
  color:#74777c;
  margin-bottom:13px;
}
.viz-file-head,.viz-meta,.gauge-labels,.viz-split{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.viz-file-head{font-size:13px;margin-bottom:10px}
.viz-file-head strong{font-size:18px}
.viz-bar,.gauge-track,.storage-stage{
  height:18px;
  border-radius:99px;
  background:#e4e5e8;
  overflow:hidden;
}
.viz-bar span,.gauge-track span,.storage-stage div{
  display:block;
  height:100%;
  width:10%;
  border-radius:inherit;
  background:linear-gradient(90deg,#6c5ce7,#9c91ff);
}
.viz-meta{
  margin-top:10px;
  color:#73767b;
  font-size:12px;
}
.viz-meta strong{color:#25272a}
.gauge-labels{font-size:11px;color:#777;margin-top:8px}
.gauge-labels strong{font-size:18px;color:#4f42b9}
.viz-split{margin-top:12px;font-size:12px;color:#666}
.viz-image-stage,.ratio-stage,.resolution-stage{
  min-height:200px;
  display:flex;
  justify-content:center;
  align-items:center;
  background:
    linear-gradient(45deg,#ececef 25%,transparent 25%),
    linear-gradient(-45deg,#ececef 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#ececef 75%),
    linear-gradient(-45deg,transparent 75%,#ececef 75%);
  background-size:24px 24px;
  background-position:0 0,0 12px,12px -12px,-12px 0;
  border-radius:12px;
  overflow:hidden;
}
#vizImageRect,#vizRatioRect,#vizResolutionRect{
  min-width:90px;
  min-height:60px;
  max-width:280px;
  max-height:180px;
  background:linear-gradient(135deg,#6c5ce7,#9187ee);
  border-radius:8px;
  box-shadow:0 10px 24px rgba(79,66,185,.18);
  display:flex;
  justify-content:center;
  align-items:center;
  color:#fff;
  font-weight:850;
  font-size:13px;
  text-align:center;
}
.storage-stage{margin:20px 0 0;height:30px}
.storage-stage div{width:10%}
.filmstrip{
  display:flex;
  gap:5px;
  height:72px;
  align-items:center;
  padding:10px;
  border-radius:10px;
  background:#22232a;
  overflow:hidden;
}
.filmstrip span{
  flex:1;
  min-width:10px;
  height:46px;
  border-radius:3px;
  background:linear-gradient(135deg,#8d84e8,#4c438f);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.08);
}
.color-swatch-large{
  height:110px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.12);
}
.color-contrast{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.color-contrast span{
  padding:11px;
  border-radius:10px;
  text-align:center;
  font-size:12px;
  font-weight:800;
}
.color-input-grid{
  display:grid;
  grid-template-columns:1.4fr 1fr 1fr 1fr;
  gap:10px;
}
.hsl-controls{margin-top:6px}
.slider-row{margin:14px 0}
.slider-row label{
  display:flex;
  justify-content:space-between;
  font-size:12px;
  font-weight:750;
  margin-bottom:6px;
}
.slider-row label span{color:#6253d6}
.slider-row input{width:100%}
@media(max-width:680px){
  .color-input-grid{grid-template-columns:1fr 1fr}
  .color-input-grid .field:first-child{grid-column:1/-1}
}

/* Compact desktop landing layout: two columns, stable card sizing. */
.grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:10px !important;
}
.grid .card{
  min-width:0;
}
@media(max-width:600px){
  .grid{grid-template-columns:1fr !important}
}

.presets{
  margin-top:18px;
}
.presets button{
  min-height:48px;
}
@media(min-width:700px){
  .presets{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .presets .preset-title{
    grid-column:1 / -1;
  }
}

/* Compact calculator layout: all tool inputs use two columns on desktop. */
#form > .field-grid,
#form > .fields-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px 16px;
}
#form > .field{
  min-width:0;
}
#form > .field:nth-child(1){
  /* Keep the grid robust even when the renderer emits fields directly. */
}
#form .field input{
  min-height:46px;
}
.presets{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px 8px !important;
  margin-top:14px !important;
  padding:12px !important;
}
.presets .preset-title{
  grid-column:1 / -1;
  margin-bottom:0 !important;
}
.presets button{
  min-height:38px !important;
  height:38px !important;
  padding:7px 10px !important;
  border-radius:9px !important;
  font-size:12px !important;
  line-height:1.15 !important;
}
.result{
  margin-top:14px !important;
}
@media(max-width:700px){
  #form > .field-grid,
  #form > .fields-grid{
    grid-template-columns:1fr;
  }
  .presets{
    grid-template-columns:1fr !important;
  }
}

.choice-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 14px}.choice-group{border:1px solid #e1e1e5;border-radius:12px;padding:12px;background:#fafafa}.choice-label{font-size:13px;font-weight:800;margin-bottom:8px}.segmented{display:flex;gap:6px;flex-wrap:wrap}.segmented button{flex:1 1 auto;min-height:40px;padding:8px 10px;border:1px solid #d7d7dd;border-radius:9px;background:#fff;font-weight:700;cursor:pointer}.segmented button.active{border-color:#6c5ce7;background:#eeeaff;color:#4f3ed0}@media(max-width:700px){.choice-row{grid-template-columns:1fr}}

/* Larger back-to-tools navigation aligned with the calculator content. */
.back-link{
  display:inline-flex !important;
  align-items:center;
  gap:7px;
  font-size:18px !important;
  font-weight:800 !important;
  line-height:1.2;
  margin:0 0 48px 0 !important;
  padding:0 !important;
}

/* Final tool navigation alignment */
.view > .back{
  display:inline-flex !important;
  align-items:center;
  gap:7px;
  min-height:0 !important;
  padding:0 !important;
  margin:0 0 48px 0 !important;
  border-radius:0 !important;
  font-size:18px !important;
  line-height:1.2 !important;
  font-weight:800 !important;
  background:transparent !important;
  color:#5b4dce !important;
}

/* Back link matches the calculator title size */
.view > .back{
  font-size:clamp(32px,5vw,46px) !important;
  font-weight:800 !important;
  letter-spacing:-.045em;
  line-height:1.05 !important;
}

/* Crawlable landing-page tool cards */
a.card{display:block;color:inherit;text-decoration:none}
a.card:hover{transform:translateY(-1px)}
.card{transition:transform .15s ease}

/* Tool-page SEO content */
.tool-seo{
  width:100%;
  border-top:1px solid var(--line);
  background:#fff;
  padding:64px 20px 76px;
}
.tool-seo-inner{
  max-width:820px;
  margin:0 auto;
}
.tool-seo-inner h1{
  margin:0 0 12px;
  font-size:clamp(34px,5vw,52px);
  line-height:1.03;
  letter-spacing:-.045em;
}
.tool-seo-intro{
  color:var(--muted);
  font-size:18px;
  margin:0 0 34px;
}
.tool-seo-inner h2{
  margin:36px 0 10px;
  font-size:25px;
  line-height:1.2;
}
.tool-seo-inner p{
  color:#575b61;
  font-size:16px;
  margin:0 0 14px;
}
.tool-seo-inner a{
  color:#5144c8;
  font-weight:700;
}
@media(max-width:760px){
  .tool-seo{padding:48px 18px 60px}
}

.tool-seo-inner>h2{font-size:clamp(30px,4.5vw,44px);margin-top:0}

/* Media Calculator global brand */
.logo, .brand {
  color: #6f55e8 !important;
  text-decoration: none;
}
