/* Smooth scroll */
html { scroll-behavior: smooth; }

:root{
  --sidebar: #A23A3A;   /* tweak to your taste */
  --bg: url('img/hero.jpg');
  --text: #222;
  --muted: #777;
  --card: #ffffff;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font:16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color:var(--text);
  background:#f6f6f6;
}

/* Layout */
.sidebar{
  position:fixed; left:0; top:0; bottom:0; width:280px;
  background:var(--sidebar);
  color:#fff; padding:28px 18px; overflow:auto;
}
.content{
  margin-left:280px; /* same as sidebar width */
}

.quote-box {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  background: #fafafa;
  border-radius: 6px;
  text-align: center; /* centers everything */
  font-style: normal; /* reset so only attribution is italic */
  color: #666;
}
.quote-box p {
  margin: 0.5rem 0;
}
.quote-author {
  font-style: italic; /* attribution only */
  display: block;
  margin-top: 0.5rem;
  color: #888;
}

.fade-in {
  opacity: 0;
  animation: fadeIn ease 2s;
  animation-fill-mode: forwards;
  animation-delay: 0.3s;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Profile */
.profile{ text-align:center; margin-bottom:22px; }
.profile img{
  width:120px; height:120px; border-radius:50%; object-fit:cover;
  display:block; margin:0 auto 12px;
}
.profile h1{ font-size:22px; margin:6px 0 2px; }
.profile p{ margin:0; opacity:.85; }

/* Nav */
.nav{ display:flex; flex-direction:column; gap:10px; margin:18px 0 22px; }
.nav a{
  display:block; padding:12px 14px; background:rgba(255,255,255,.12);
  color:#fff; text-decoration:none; border:1px solid rgba(255,255,255,.2);
  border-radius:6px; transition:.15s ease;
}
.nav a:hover{ background:rgba(255,255,255,.18); }
.nav a.active{ outline:2px solid #fff; background:rgba(255,255,255,.24); }

/* Footer in sidebar */
.foot{ color:#ffe; opacity:.9; font-size:14px; margin-top:8px; text-align:center; }
.foot a{ color:#fff; }

/* Hero */
.hero{
  min-height:70vh;
  /*background-image:var(--bg); */
  background-size:cover; background-position:center;
  display:flex; align-items:center; justify-content:center;
  padding:48px 24px;
}
/*
.hero::before{
  content:""; position:absolute; inset:0; left:280px;
  background:linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.35));
  pointer-events:none;
}
*/

body::before{
  content:"";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.25)),
    url('img/hero.jpg') center / cover no-repeat;
  z-index:-1;
}

.hero-inner{
  position:relative; z-index:1; max-width:980px; margin:0 auto;
  background:rgba(255,255,255,.92); padding:28px; border-radius:12px;
  box-shadow:0 10px 24px rgba(0,0,0,.1);
}
.hero h2{ margin:0 0 8px; font-size:32px; }
.hero p{ margin:0 0 16px; color:#444; }

/* Feature images like Zhijian */
.feature-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:10px;
}
.feature-grid img{ width:100%; border-radius:8px; display:block; }

/* Weeks */
.week{
  background: rgba(255,255,255,.94);
  margin: 100px auto;      /* bigger gap between weeks */
  padding: 40px;           /* give the card itself more breathing room */
  max-width: 980px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  position: relative;
}


/* Thumbnails like Junqing */
.thumbs{
  display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; margin:12px 0 8px;
}
.thumbs img{ width:100%; border-radius:8px; display:block; }

/* Two-column text block */
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.two-col h4 { margin-bottom:6px; }

/* Files list */
.files{ margin-top:4px; }
.files a{ color:#0b63ce; }

/* Site footer */
.site-foot{ text-align:center; color:var(--muted); padding:30px 12px; }

/* Responsive */
@media (max-width: 980px){
  .sidebar{ position:static; width:auto; }
  .content{ margin-left:0; }
  .hero::before{ left:0; }
  .feature-grid{ grid-template-columns:1fr; }
  .two-col{ grid-template-columns:1fr; }
  .thumbs{ grid-template-columns:repeat(2, 1fr); }
}

/* Site-wide fixed background */
body::before{
  content:"";
  position: fixed;
  inset: 0;            /* top/right/bottom/left: 0 */
  background: url('img/hero.jpg') center / cover no-repeat;
  z-index: -1;         /* stay behind all page content */
}

/* Fullscreen loader */
#loader{
  position: fixed; inset: 0;
  background: rgb(255, 255, 255); /* page-color while loading */
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;                       /* above everything */
  opacity: 1; transition: opacity .35s ease;
}
#loader.hidden{ opacity: 0; pointer-events: none; }

.loader-inner{ text-align:center; width:min(640px, 90vw); }
#loader-percent{
  font-size: clamp(28px, 8vw, 72px);
  letter-spacing: .03em;
  color: #ff9ecf;    /* light pink */
  margin-bottom: 16px;
  font-weight: 600;
  z-index: 1;
}

/* Full-width sweep line across the entire screen */
.loader-line{
  position: fixed;
  left: 0; right: 0;
  top: 58%;
  height: 2px;
  background: #ffcde2;                 /* light pink */
  transform: scaleX(0);/* start collapsed */
  transform-origin: left;
  transition: transform .35s ease;      /* sweep speed */
  z-index: 0;                            /* above the percent text */
}

/* When we add .sweep on #loader, animate to 100% width */
#loader.sweep .loader-line{
  transform: scaleX(1);
}

/* Fade in everything after loader */
body.loaded main,
body.loaded aside {
  animation: fadeIn .8s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.week-content {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 16px;
}

.week-text {
  flex: 1;
}

.week-video video {
  width: 100%;        /* take full width of its column */
  max-width: 500px;   /* increase this if you want even bigger */
  height: auto;       /* keeps aspect ratio */
  border-radius: 8px; /* optional: rounded corners */
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* optional: subtle shadow */
}

.design-section {
  text-align: center;
  margin: 40px auto;
  max-width: 90%;   /* keeps it inside your white borders */
}

.design-section img {
  width: 100%;       /* scale up as big as possible */
  max-width: 1000px; /* but don’t explode beyond readable size */
  height: auto;
  display: block;
  margin: 0 auto 20px auto; /* center and add spacing */
}

.design-notes {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;   /* keeps the paragraph aligned neatly */
}

/* Full-width container (same idea as your big image) */
.full-bleed{
  margin: 32px auto;
  max-width: 1200px;            /* cap on huge screens */
  width: min(96vw, 1200px);     /* responsive width */
}

/* Video block styling */
.video-block{
  margin: 24px auto;
  text-align: center;
  max-width: 900px;       /* keeps it inside the white column */
}
.video-block .video-frame{
  width: 100%;            /* scales with parent */
  height: auto;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  background: #000;             /* nice while loading */
}

/* Default to 16:9; browser will honor intrinsic aspect if different */
.video-block video{
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Vertical video helper (9:16 feel, but still responsive) */
.video-block.portrait video{
  aspect-ratio: 9 / 16;
  max-height: 80vh;             /* keeps it from getting too tall */
}

/* Caption styling */
.video-block figcaption{
  font-size: 14px;
  color: #777;
  margin-top: 6px;
}

/* Rainbow, wavy "Jesse" letters */
.rainbow-word { 
  white-space: nowrap; 
  font-weight: 700;
}

.rainbow-word span {
  display: inline-block;
  /* moving rainbow gradient */
  background-image: linear-gradient(90deg,
    #ff5f6d, #ffc371, #9be15d, #48c6ef, #6f86d6, #ff5f6d);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* animate BOTH the rainbow shift and the wave */
  animation: rainbow 3s linear infinite, wave 2s ease-in-out infinite;

  /* stagger each letter using the custom property --i */
  animation-delay: calc(var(--i) * 0.12s), calc(var(--i) * 0.12s);
}

/* vertical bob */
@keyframes wave {
  0%, 100% { transform: translateY(0); }
  25%      { transform: translateY(-6px); }
  75%      { transform: translateY(6px); }
}

/* sliding gradient */
@keyframes rainbow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* motion-safe fallback */
@media (prefers-reduced-motion: reduce) {
  .rainbow-word span { animation: none; background-position: 50% 50%; }
}

/* Rainbow effect for whole words/headings */
.rainbow-word-heading {
  display: inline-block;
  font-weight: 700;
  background-image: linear-gradient(90deg,
    #ff5f6d, #ffc371, #9be15d, #48c6ef, #6f86d6, #ff5f6d);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow 3s linear infinite, wave 2s ease-in-out infinite;
}

.rainbow-wave {
  display: inline-block;
  font-weight: bold;
  background-image: linear-gradient(
    90deg,
    red,
    orange,
    yellow,
    green,
    blue,
    indigo,
    violet
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: wave 2s infinite ease-in-out, rainbow 4s linear infinite;
}

/* Wavy motion */
@keyframes wave {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(4px); }
}

/* Shifting rainbow effect */
@keyframes rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* --- Laser steps card --- */
#laser-steps.card{
  max-width: 980px;
  margin: 32px auto;
  background: rgba(255,255,255,.92);
  padding: 28px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* Numbered steps */
.steps{
  counter-reset: step;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps > li{
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: start;
  gap: 14px;
  padding: 14px 12px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  background: #fff;
}
.steps > li::before{
  content: counter(step);
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9ab3, #ffd1e0);
  color: #7a1f3d;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(255,154,179,.35);
}

/* Inline keycaps */
kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
  padding: .2em .5em;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.15);
  background: linear-gradient(#f8f8f9, #ececf0);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
  white-space: nowrap;
}

/* Color legend for cut/engrave */
.legend{
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.legend li{ display:flex; align-items:center; gap:10px; }
.chip{
  width: 18px; height: 18px;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.06) inset;
}
.chip-red{  background:#ff4b4b; }
.chip-blue{ background:#3a86ff; }

/* Small callout box */
.callout{
  margin-top: 8px;
  border-left: 4px solid #ffafcc;
  background: #fff6fa;
  padding: 10px 12px;
  border-radius: 8px;
}

/* Optional: make links/notes inside nicer */
#laser-steps code{
  background: #f5f5f7;
  padding: .1em .35em;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* --- Results Table --- */
#laser-results.card {
  max-width: 980px;
  margin: 32px auto;
  background: rgba(255,255,255,.95);
  padding: 28px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.results {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}
.results th, .results td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  vertical-align: top;
}
.results th {
  text-align: left;
  font-weight: 600;
  background: #fafafa;
}
.results tr:hover td {
  background: #fff7fb;
}
.results td strong { color: #b5179e; }
.results td em { color: #2a9d8f; font-weight: 500; }

/* Special highlight for recommendation row */
.results tr.recommend td {
  background: #fef6ff;
  border-left: 4px solid #b5179e;
}

/* Color chips (reuse from legend) */
.chip {
  display:inline-block;
  width:14px; height:14px;
  border-radius:3px;
  margin-right:6px;
}
.chip-red { background:#ff4b4b; }
.chip-blue { background:#3a86ff; }

.videos-row { display:flex; gap:20px; }
.week-video { flex:1 1 0; }

.video-block {
  position: relative;
  width: 100%;
  height: auto;         /* let it grow naturally */
  overflow: hidden;
}

.video-block > video {
  width: 100%;          /* fill horizontally */
  height: auto;         /* keep original height ratio */
  object-fit: contain;  /* no cropping, respect full video */
  display: block;
}


/* Mobile: stack */
@media (max-width: 800px){
  .videos-row{ flex-direction: column; }
}

/* --- Vinyl section layout helpers --- */
.media-grid{
  display:grid;
  gap:16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items:start;
}
.media-grid img{
  width:100%;
  height:auto;
  border-radius:12px;
  box-shadow:0 10px 24px rgba(0,0,0,.1);
}

.two-col{
  display:grid;
  gap:24px;
  grid-template-columns: 1.15fr 1fr; /* video a bit wider */
  align-items:start;
  margin-top:18px;
}
@media (max-width: 900px){
  .two-col{ grid-template-columns: 1fr; }
}

.hero-video{
  width:100%;
  max-width:100%;
  display:block;
  border-radius:12px;
  box-shadow:0 12px 28px rgba(0,0,0,.16);
}

/* tidy ordered list */
.nice-list{
  padding-left:1.25rem;
  margin:0;
}
.nice-list li{
  margin:10px 0 12px;
  line-height:1.5;
}

/* optional rainbow subhead styling (reuses your rainbow system) */
.rainbow-sub{
  display:inline-block;
  background-image:linear-gradient(90deg,#ff8a8a,#ffd084,#eaff8b,#9cffd3,#9cc9ff,#d7a5ff,#ff8a8a);
  background-size:400% 400%;
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  animation:rbw 6s linear infinite;
}
@keyframes rbw{
  0%{background-position:0% 50%}
  100%{background-position:100% 50%}
}

/* --- Week-2 flow helpers --- */
/* Inner cards that LIVE INSIDE .week */
.w2-card{
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  padding: 14px;
  margin: 0 0 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden; /* keeps code/video fully inside the white card */
}

/* Two-column layout for week body (left text / right media) */
.w2-grid{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px){
  .w2-grid{ grid-template-columns: 1fr; }
}

/* Stack cards in the media column cleanly */
.w2-media .w2-card + .w2-card{ margin-top: 16px; }

/* Code window — make sure rounded corners clip the sticky gutter */
.code-window{
  background:#0f172a; color:#e5e7eb;
  border-radius:12px;
  /* padding only on top/btm; horizontal padding comes from child grid */
  padding:.6rem 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 10px 24px rgba(0,0,0,.18);
  max-height:420px;
  overflow:auto;      /* enables scroll + clips inner sticky gutter */
  width:100%;         /* no accidental overflow */
  -webkit-mask-image: radial-gradient(#000 99%, transparent 100%); /* Safari corner fix */
          mask-image: radial-gradient(#000 99%, transparent 100%);
}
.code-window pre{
  margin:0;
  display:grid;
  grid-template-columns:auto 1fr;  /* gutter + code */
}
.code-nums{
  user-select:none; text-align:right; padding:0 .75rem; color:#9ca3af;
  border-right:1px solid rgba(255,255,255,.06);
  position:sticky; left:0;
  background:#0f172a;
}
.code-nums div{ padding:.05rem 0; }
.code-body{ padding:.4rem .9rem; white-space:pre; tab-size:2; }

/* Media inside cards */
.w2-card video, .w2-card img{
  width:100%; height:auto; display:block; border-radius:10px;
}
.w2-cap{ font-size:.9rem; opacity:.75; margin-top:.35rem; }

/* Ensure code stays inside its white parent card */
.w2-card .code-window {
  border-radius: 10px;
  overflow: hidden;   /* clip sticky gutter + dark bg to inside the card */
  margin: 0;          /* reset any margin pushing it out */
}

.video-row {
  display: flex;
  gap: 1rem;          /* spacing between videos */
}
.video-row figure {
  flex: 1;            /* make both equal width */
}
.video-row iframe {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  display: block;
  object-fit: cover;    /* zoom/crop instead of black bars */
}

.gif-container {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap; /* stack on small screens */
}

.gif-item {
  flex: 1 1 45%; /* ~half width */
  text-align: center;
}

.gif-item img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}



