:root{
  --paper:#f4efe2;
  --paper-dark:#ebe4d4;
  --ink:#2b2b2b;
  --ink-soft:#6f6858;
  --line:#d0c8b5;
  --line-dark:#b8af9b;
  --button:#e7e1cf;
  --button-hover:#ddd4bf;
  --shadow:0 10px 28px rgba(64, 47, 23, 0.08);
}

*{
  box-sizing:border-box;
}

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

body{
  font-family:"Libre Baskerville", serif;
  background:var(--paper);
  color:var(--ink);
  position:relative;
}

.paper-noise{
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.16;
  background-image:
    radial-gradient(rgba(80,60,30,.08) 0.7px, transparent 0.7px),
    radial-gradient(rgba(80,60,30,.05) 0.7px, transparent 0.7px);
  background-size:18px 18px, 27px 27px;
  background-position:0 0, 9px 9px;
}

.app{
  display:grid;
  grid-template-columns:240px 1fr;
  min-height:100vh;
  position:relative;
  z-index:1;
}

.sidebar{
  background:linear-gradient(180deg, var(--paper-dark), #e6decc);
  border-right:2px solid var(--line);
  padding:28px 20px;
}

.sidebar-head{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:18px;
}

.sidebar h2{
  margin:0 0 6px;
  font-family:"Playfair Display", serif;
  font-size:24px;
}

.sidebar-subtext{
  margin:0;
  color:var(--ink-soft);
  font-size:13px;
}

.mini-btn{
  align-self:flex-start;
  padding:8px 12px;
  font-size:12px;
}

.historyItem{
  display:flex;
  overflow:hidden;
  margin-bottom:12px;
  border:1px solid var(--line);
  cursor:pointer;
  background:#fffaf0;
  box-shadow:var(--shadow);
}

.historyItem div{
  width:20%;
  height:28px;
}

.main{
  padding:44px 48px 60px;
}

.eyebrow{
  margin:0 0 8px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:12px;
  color:var(--ink-soft);
}

.header h1{
  margin:0;
  font-family:"Playfair Display", serif;
  font-size:46px;
  line-height:1.05;
}

.header-copy{
  max-width:760px;
  color:var(--ink-soft);
  margin:12px 0 0;
  line-height:1.7;
  font-size:15px;
}

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:30px;
  margin-bottom:32px;
  align-items:center;
}

button,
.upload{
  background:var(--button);
  border:1px solid var(--line-dark);
  padding:11px 18px;
  font-family:"Libre Baskerville", serif;
  font-size:14px;
  cursor:pointer;
  color:var(--ink);
  box-shadow:0 2px 0 rgba(120, 100, 70, 0.08);
  transition:background .15s ease, transform .15s ease;
}

button:hover,
.upload:hover{
  background:var(--button-hover);
  transform:translateY(-1px);
}

.upload input{
  display:none;
}

.paletteCanvas{
  display:flex;
  justify-content:center;
  min-height:420px;
}

.palettePage{
  display:flex;
  gap:28px;
}

.colorCard{
  height:390px;
  width:128px;
  background:#fffdf8;
  border:1px solid var(--line);
  display:flex;
  flex-direction:column;
  box-shadow:var(--shadow);
}

.colorSwatch{
  flex:1;
}

.swatchLabel{
  padding:14px 10px 16px;
  background:var(--paper);
  border-top:1px solid var(--line);
  text-align:center;
  font-size:12px;
  line-height:1.5;
  cursor:pointer;
}

.swatchHex{
  font-weight:700;
  letter-spacing:.03em;
}

.colorName{
  margin-top:4px;
  font-style:italic;
  color:var(--ink-soft);
}

.lock{
  margin-top:6px;
  font-size:12px;
  cursor:pointer;
  color:#6f6858;
}

.gradientCard{
  width:min(760px, 100%);
  height:320px;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  display:flex;
  align-items:flex-end;
  background:#fff;
}

.gradientLabel{
  width:100%;
  padding:14px 16px;
  border-top:1px solid var(--line);
  background:rgba(244, 239, 226, 0.92);
  text-align:center;
  line-height:1.7;
  font-size:13px;
}

.explanation-box{
  max-width:760px;
  margin:26px auto 0;
  padding:18px 20px;
  background:#fffaf0;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.explanation-box h3{
  margin:0 0 8px;
  font-family:"Playfair Display", serif;
  font-size:24px;
}

.explanation-box p{
  margin:0;
  line-height:1.7;
  color:var(--ink-soft);
}

.explanation-example{
  margin-top:10px !important;
  color:var(--ink);
  font-style:italic;
}

.saved{
  margin-top:48px;
}

.saved-head h3{
  margin:0;
  font-family:"Playfair Display", serif;
  font-size:26px;
}

.saved-head p{
  margin:8px 0 18px;
  color:var(--ink-soft);
  font-size:14px;
}

.savedPalette{
  display:flex;
  border:1px solid var(--line);
  margin-bottom:10px;
  background:#fffaf0;
  box-shadow:var(--shadow);
  cursor:pointer;
  width:max-content;
  overflow:hidden;
}

.savedPalette div{
  width:24px;
  height:24px;
}

.modal{
  position:fixed;
  inset:0;
  background:rgba(40, 30, 18, 0.38);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
}

.hidden{
  display:none !important;
}

.modal-box{
  width:min(420px, calc(100% - 24px));
  background:var(--paper);
  border:1px solid var(--line-dark);
  box-shadow:var(--shadow);
  padding:28px;
  text-align:center;
}

.modal-box h3{
  margin:0 0 10px;
  font-family:"Playfair Display", serif;
  font-size:28px;
}

.modal-box p{
  margin:0;
  color:var(--ink-soft);
  line-height:1.6;
}

.modal-actions{
  margin-top:22px;
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width:1100px){

.app{
grid-template-columns:1fr;
}

.sidebar{
border-right:none;
border-bottom:2px solid var(--line);
}

.main{
padding:28px 20px 40px;
}

.palettePage{
flex-wrap:wrap;
justify-content:center;
}

}

@media (max-width:680px){

.header h1{
font-size:34px;
}

.colorCard{
width:110px;
height:340px;
}

.controls{
gap:8px;
}

button,
.upload{
padding:10px 14px;
font-size:13px;
}

}

.logo-title{
display:flex;
align-items:center;
gap:14px;
}

.logo{
width:55px;
height:55px;
object-fit:contain;
}