*{box-sizing:border-box}
:root{
  --ink:#211d19;
  --body:#4f4942;
  --muted:#7b7166;
  --paper:#f8f4ed;
  --card:#fffdf9;
  --line:#e6dccf;
  --gold:#c78b36;
  --gold2:#a96f24;
  --lav:#9c82aa;
  --green:#315e53;
  --shadow:0 14px 34px rgba(72,55,38,.07);
}
html,body{margin:0;min-height:100%;color:var(--ink);font-family:"Noto Serif KR","Nanum Myeongjo",serif}
body{background:#f7f3ec}
.paper-layer{
  position:fixed;inset:0;z-index:-3;pointer-events:none;
  background:
    linear-gradient(rgba(250,248,244,.84),rgba(250,248,244,.84)),
    url("../paper-texture-ready.webp") center top/cover no-repeat;
}
.paper-layer:after{
  content:"";position:absolute;inset:0;
  background:repeating-linear-gradient(0deg,rgba(70,54,36,.012) 0 1px,transparent 1px 5px)
}
button,a,textarea{font:inherit}
button{cursor:pointer}

.site-head{
  height:64px;padding:0 max(24px,calc((100vw - 1440px)/2));
  display:flex;align-items:center;gap:18px;
  background:rgba(255,253,249,.90);border-bottom:1px solid rgba(130,104,72,.11);
  backdrop-filter:blur(12px);position:sticky;top:0;z-index:30
}
.brand{display:flex;align-items:center;gap:9px;color:#1e1a17;text-decoration:none;font-size:21px}
.brand-mark{
  width:28px;height:28px;border-radius:50%;display:grid;place-items:center;
  background:#24211d;color:#d7a24c;font-size:12px;box-shadow:0 3px 8px rgba(0,0,0,.14)
}
.crumb{color:#8a7f74;font-size:13px}
.head-actions{margin-left:auto;display:flex;gap:8px}
.head-pill{
  border:1px solid #e2d8cb;background:#fffdfa;color:#3a342e;text-decoration:none;
  border-radius:999px;padding:8px 14px;font-size:12px;font-weight:700
}

.copy-hero{
  min-height:270px;position:relative;overflow:hidden;
  background:
    linear-gradient(90deg,rgba(250,247,241,.99) 0%,rgba(250,247,241,.92) 45%,rgba(250,247,241,.18) 78%,rgba(250,247,241,.03) 100%),
    url("../hero-sun-wash.png") 70% 0/220px auto no-repeat,
    url("../hero-mountain.png") right 18% top 0/760px auto no-repeat;
  border-bottom:1px solid rgba(139,108,69,.10)
}
.copy-hero-text{width:min(1440px,calc(100% - 48px));margin:auto;padding:46px 0 38px}
.hero-kicker{font-size:13px;color:#a76e24;letter-spacing:.13em;font-weight:800;margin-bottom:12px}
.copy-hero h1{font-family:"Nanum Myeongjo";font-size:50px;line-height:1.05;margin:0 0 12px;letter-spacing:-1px}
.copy-hero h2{font-size:20px;margin:0 0 12px;font-weight:700}
.copy-hero p{font-size:13.5px;line-height:1.9;color:#5d554d;margin:0;max-width:650px}

.copy-layout{
  width:min(1440px,calc(100% - 48px));margin:-6px auto 60px;
  display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:18px;align-items:start
}
.copy-main-card,.side-card{
  background:rgba(255,253,249,.94);border:1px solid var(--line);box-shadow:var(--shadow)
}
.copy-main-card{border-radius:24px;padding:22px}
.copy-side{display:flex;flex-direction:column;gap:14px}
.side-card{border-radius:20px;padding:20px}

.copy-title-row{display:grid;grid-template-columns:145px 1fr;gap:20px;align-items:center}
.number-card{
  min-height:105px;border-radius:18px;padding:16px 18px;
  background:linear-gradient(145deg,#fff5df,#f6ddb0);border:1px solid #eccd94;color:#80551d
}
.number-card small{display:block;font-size:11px;font-weight:700;margin-bottom:6px}
.number-card strong{font-family:"Nanum Myeongjo";font-size:42px;line-height:1}
.number-card span{font-size:18px;margin-left:3px}
.copy-title-main{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap}
.copy-title h2{font-family:"Nanum Myeongjo";font-size:34px;margin:0}
.hanja-inline{font-size:21px;color:#7f7469}
.copy-title p{margin:7px 0 0;color:#635a51;font-size:14px}

.quote-panel{
  position:relative;overflow:hidden;margin-top:16px;border:1px solid #ead8b8;border-radius:18px;
  min-height:150px;padding:28px 180px 24px 165px;
  background:
    url("../temple-silhouette.png") right bottom/48% auto no-repeat,
    linear-gradient(135deg,#fffaf0,#f9edd9)
}
.quote-lotus{position:absolute;left:16px;bottom:-8px;width:140px;opacity:.72}
.quote-panel blockquote{
  margin:0;font-family:"Nanum Myeongjo";font-size:24px;line-height:1.7;font-weight:700;white-space:pre-line
}
.source{text-align:center;margin-top:10px;color:#927e65;font-size:10.5px}

.read-panel{margin-top:16px;padding:18px 4px 2px}
.section-title{display:flex;align-items:center;gap:8px;font-size:16px}
.section-icon{color:#a77028}
.explain{margin-top:10px;color:#514a43;font-size:14px;line-height:1.9;white-space:pre-line}

.write-section{margin-top:18px}
.write-head{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:9px}
.write-head>span{font-size:11px;color:#8b8075}
.copy-guide{
  border:1px solid #eadfce;border-radius:14px 14px 0 0;padding:13px 16px;
  background:#fffaf2;color:#524940;font-size:13px;line-height:1.8;white-space:pre-line
}
.writing-area,.memo-area{
  display:block;width:100%;resize:vertical;outline:0;color:#302b26;
  border:1px solid #dfd4c5;background:rgba(255,254,251,.94);
  padding:16px 18px;font-size:15px
}
.writing-area{
  border-top:0;border-radius:0 0 14px 14px;line-height:2.5;
  background:
    repeating-linear-gradient(180deg,rgba(255,254,251,.96) 0 39px,rgba(181,151,110,.15) 40px)
}
.memo-area{border-radius:14px;line-height:1.8}
.writing-area:focus,.memo-area:focus{border-color:#c9a468;box-shadow:0 0 0 3px rgba(199,139,54,.09)}
.question{font-size:14px;line-height:1.8;color:#514a43;margin:0 0 9px}
.action-row{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}
.primary-btn,.ghost-btn{
  min-height:48px;border-radius:999px;padding:0 24px;font-weight:800;font-size:13px
}
.primary-btn{
  border:0;background:linear-gradient(135deg,#d39a47,#b87625);color:#fff;box-shadow:0 8px 18px rgba(165,106,34,.16)
}
.ghost-btn{border:1px solid #ded3c5;background:#fffdfa;color:#61584f}
.save-hint{text-align:right;color:#93877a;font-size:10px;margin:9px 4px 0}

.side-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.side-head h3{margin:0;font-size:15px}
.text-btn{border:0;background:transparent;color:#7a6c5f;font-size:11px}
.progress-big{margin-top:18px;color:#b2772d}.progress-big strong{font-family:"Nanum Myeongjo";font-size:36px}.progress-big span{font-size:18px}
.progress-track{height:10px;border-radius:999px;background:#eee8e0;margin:10px 0 14px;overflow:hidden}
.progress-track i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#d29a48,#b87928);transition:width .25s}
.lotus-row{display:flex;gap:3px;flex-wrap:wrap}.lotus-dot{font-size:15px;opacity:.20;filter:grayscale(1)}.lotus-dot.done{opacity:1;filter:none}
.side-title{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:800}
.side-title span{color:#9678a4}
.keyword-card{background:linear-gradient(145deg,#fffdfa,#f7f1fa)}
.keyword-list{display:flex;gap:6px;flex-wrap:wrap;margin-top:13px}
.keyword-list span{padding:6px 9px;border-radius:999px;background:#f1ecf4;color:#6e6076;font-size:10px}
.insight-card{position:relative;overflow:hidden;display:flex;gap:12px;background:linear-gradient(145deg,#fffdfa,#f4edf7)}
.insight-card img{position:absolute;right:-10px;bottom:-20px;width:110px;opacity:.18}
.insight-card p{position:relative;margin:9px 0 0;color:#5b5350;font-size:12px;line-height:1.8}

.vertical-hanja{position:fixed;left:-9999px}

.sheet-backdrop{position:fixed;inset:0;z-index:40;background:rgba(42,35,27,.30);backdrop-filter:blur(3px)}
.sheet{
  position:fixed;z-index:41;left:50%;bottom:0;width:min(720px,100%);max-height:84vh;
  transform:translate(-50%,105%);transition:transform .28s ease;background:#fbf8f2;
  border-radius:26px 26px 0 0;box-shadow:0 -22px 60px rgba(42,31,20,.18);padding:10px 18px 28px;overflow:auto
}
.sheet.open{transform:translate(-50%,0)}
.sheet-handle{width:48px;height:5px;background:#d8ccbd;border-radius:999px;margin:2px auto 15px}
.sheet-head{display:flex;justify-content:space-between;align-items:start}.sheet-head h3{font-family:"Nanum Myeongjo";font-size:28px;margin:2px 0 0}
.sheet-kicker{font-size:11px;color:#a6722b}.sheet-close{border:0;background:transparent;font-size:22px;color:#50473f}
.sheet-desc{font-size:12px;color:#83776c}
.content-list{display:flex;flex-direction:column;gap:8px;margin-top:16px}
.content-item{
  width:100%;display:grid;grid-template-columns:44px 1fr 22px;gap:10px;align-items:center;
  border:1px solid #e5dacb;background:#fffdfa;border-radius:15px;padding:11px;text-align:left;color:#332d27
}
.content-item.current{border-color:#c99954;background:#fff8e9}
.content-num{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#f2e7d4;font-size:10px}
.content-main b{display:block;font-size:14px}.content-main small{display:block;margin-top:3px;color:#887c70;font-size:10px}.content-arrow{font-size:18px;color:#9a856e}

.complete-overlay{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:22px;background:rgba(39,31,24,.38);backdrop-filter:blur(5px)}
.complete-card{width:min(400px,100%);background:#fffaf2;border:1px solid #eadbc4;border-radius:26px;padding:32px 24px 24px;text-align:center;box-shadow:0 28px 70px rgba(38,28,18,.22)}
.complete-lotus{width:100px;height:100px;object-fit:contain}.complete-card h3{font-family:"Nanum Myeongjo";font-size:25px;line-height:1.55;margin:5px 0 10px}.complete-card p{color:#746a60;font-size:13px;line-height:1.8}.complete-card .primary-btn,.complete-card .ghost-btn{width:100%;margin-top:9px}
[hidden]{display:none!important}

@media(max-width:980px){
  .copy-layout{grid-template-columns:1fr;width:min(800px,calc(100% - 30px))}
  .copy-side{display:grid;grid-template-columns:1fr 1fr}.progress-side{grid-row:span 2}
}
@media(max-width:620px){
  .site-head{height:58px;padding:0 12px;gap:9px}.brand{font-size:17px}.crumb{display:none}.head-pill{padding:7px 10px;font-size:10px}
  .copy-hero{
    min-height:350px;
    background:
      linear-gradient(90deg,rgba(250,247,241,.99) 0%,rgba(250,247,241,.90) 64%,rgba(250,247,241,.12) 100%),
      url("../hero-sun-wash.png") 79% 20px/170px auto no-repeat,
      url("../hero-mountain.png") right -120px bottom/620px auto no-repeat
  }
  .copy-hero-text{width:calc(100% - 28px);padding:35px 0}.copy-hero h1{font-size:37px}.copy-hero h2{font-size:18px;max-width:280px}.copy-hero p{font-size:12px;max-width:310px}
  .copy-layout{width:calc(100% - 20px);margin:12px auto 42px}
  .copy-main-card{padding:14px;border-radius:20px}
  .copy-title-row{grid-template-columns:96px 1fr;gap:12px}.number-card{min-height:86px;padding:13px}.number-card strong{font-size:32px}.copy-title h2{font-size:25px}.hanja-inline{font-size:16px}.copy-title p{font-size:11px}
  .quote-panel{padding:22px 16px 24px 95px;min-height:150px;background-size:75% auto,cover}.quote-lotus{width:90px;left:3px;bottom:-1px}.quote-panel blockquote{font-size:18px;line-height:1.7}.source{text-align:left;margin-left:0}
  .write-head{align-items:flex-start;flex-direction:column;gap:4px}.write-head>span{font-size:9.5px}
  .copy-guide{font-size:12px}.writing-area,.memo-area{font-size:14px}
  .action-row{flex-direction:column-reverse}.primary-btn,.ghost-btn{width:100%}
  .copy-side{display:flex}.side-card{padding:16px;border-radius:18px}
}


/* =========================================================
   PERFORMANCE / DEVICE COMPATIBILITY
   Desktop + iOS Safari + Android Chrome
========================================================= */

/* Avoid iOS Safari fixed-background repaint bottleneck */
.paper-layer{
  background-attachment:scroll!important;
  transform:translateZ(0);
}

/* Keep images lightweight to composite */
.copy-hero,
.quote-panel,
.insight-card{
  contain:paint;
}

/* Touch devices: remove costly blur and heavy shadows */
@media (hover:none), (pointer:coarse){
  .site-head{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    background:rgba(255,253,249,.98)!important;
  }

  .sheet-backdrop,
  .complete-overlay{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }

  .copy-main-card,
  .side-card,
  .sheet,
  .complete-card{
    box-shadow:0 5px 16px rgba(72,55,38,.06)!important;
  }

  .paper-layer{
    position:absolute!important;
    min-height:100%;
  }
}

/* iPad portrait/landscape */
@media (min-width:621px) and (max-width:1100px){
  .copy-layout{
    width:min(860px,calc(100% - 28px))!important;
    grid-template-columns:1fr!important;
  }

  .copy-side{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
  }

  .progress-side{
    grid-row:span 2;
  }

  .copy-hero{
    background-position:72% 10px,right -70px top 20px!important;
    background-size:180px auto,650px auto!important;
  }
}

/* Phones: keep DOM and paint area simple */
@media(max-width:620px){
  .copy-hero{
    min-height:310px!important;
  }

  .copy-side{
    display:flex!important;
  }

  .quote-panel{
    background-image:linear-gradient(135deg,#fffaf0,#f9edd9)!important;
  }

  .paper-layer:after{
    display:none!important;
  }
}

/* Respect reduced-motion and lower-power settings */
@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    transition:none!important;
    animation:none!important;
  }
}


/* =========================================================
   COPY TYPOGRAPHY POLISH
   Cleaner desktop Korean typography; serif only for key titles/quotes.
========================================================= */
html,body,button,input,textarea,select{
  font-family:"Pretendard","SUIT","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif!important;
}
.brand,
.copy-hero p,
.copy-title p,
.explain,
.write-head,
.write-head>span,
.copy-guide,
.writing-area,
.memo-area,
.question,
.side-card,
.content-list,
.head-pill,
.crumb{
  font-family:"Pretendard","SUIT","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif!important;
}
.copy-hero h1,
.copy-hero h2,
.copy-title h2,
.number-card strong,
.quote-panel blockquote,
.complete-card h3,
.sheet-head h3{
  font-family:"Noto Serif KR","Nanum Myeongjo","AppleMyungjo",serif!important;
}
.copy-hero h1{
  font-weight:700!important;
  letter-spacing:-1.5px!important;
}
.quote-panel blockquote{
  font-weight:700!important;
}
.explain,
.copy-guide,
.writing-area,
.memo-area{
  color:#413b35!important;
}

/* Desktop layout text proportions */
@media(min-width:1101px){
  .copy-hero h1{font-size:48px!important}
  .copy-hero h2{font-size:19px!important}
  .copy-hero p{font-size:13.5px!important}
  .copy-title h2{font-size:32px!important}
  .quote-panel blockquote{font-size:22px!important}
}
