:root{
  --bg: #0f1115;
  --panel: #141824;
  --panel2: #10131b;
  --text: #e9e9ef;
  --muted: rgba(233,233,239,0.68);
  --stroke: rgba(233,233,239,0.14);
  --accent: #3a7bfd;

  /* CAD lines */
  --cadLine: rgba(233,233,239,0.22);
  --cadLabel: rgba(233,233,239,0.55);
  --cadLabelBg: rgba(15,17,21,0.88);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ====== Top Scene Header ====== */
.sceneHeader{
  position: relative;
  background: linear-gradient(180deg, var(--panel2), var(--bg));
  border-bottom: 1px solid var(--stroke);
  overflow: visible;
  padding-top: 3.2rem; /* reserve space for fixed top nav */
}

/* Top nav */
.topNav{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.25rem 0.25rem;
  background: linear-gradient(180deg, rgba(16,19,27,0.96), rgba(16,19,27,0.75));
  backdrop-filter: blur(6px);
}

.navItem{
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 180ms;
}
.navItem:hover{
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255,255,255,0.03);
}

/* 3 image boxes row */
.sceneTiles{
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem; /* tighter now because no arc */
}

.tile{
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(233,233,239,0.22);
  border-radius: 14px;
  min-height: 160px;
  transition: 180ms;
  position: relative;
}
.tile:hover{
  border-style: solid;
  border-color: rgba(58,123,253,0.6);
  transform: translateY(-2px);
  background: rgba(58,123,253,0.06);
}

.tileInner{
  height: 100%;
  padding: 1rem;
  display:flex;
  flex-direction: column;
  justify-content: space-between;
}

.tileLabel{
  font-weight: 800;
  letter-spacing: 0.2px;
}

.tileHint{
  color: var(--muted);
  font-size: 0.95rem;
}

/* ===== CAD name block (flat rule + dimension frame) ===== */
.cadNameWrap{
  position: relative;
  z-index: 10;
  padding: 0 1.25rem 1.75rem;
}

.cadTopRule{
  height: 1px;
  background: rgba(233,233,239,0.18);
  width: 100%;
  margin: 0.75rem 0 1.25rem;
}

.cadNameBox{
  position: relative;
  width: min(920px, 92vw);
  margin: 0 auto;
  padding: 1.15rem 2.85rem 2.25rem; /* extra bottom room for width dimension */
  user-select: none;
  touch-action: none;
}

.cadNameText{
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(233,233,239,0.92);
  text-transform: uppercase;
  line-height: 1.03;
  font-size: clamp(34px, 4.2vw, 54px);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,0.55);
}

@media (max-width: 520px){
  .cadNameText{
    flex-direction: column;
    gap: 0.15rem;
    white-space: normal;
    letter-spacing: 0.10em;
  }
}

/* Dimension line (width) */
.dimX{
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 22px;
  pointer-events: none;
  border-top: 1px solid var(--cadLine);
}
.dimX .tick{
  position: absolute;
  top: -7px;
  width: 1px;
  height: 14px;
  background: var(--cadLine);
}
.dimX .tick.left{ left: 0; }
.dimX .tick.right{ right: 0; }

/* Move label slightly DOWN so it doesn’t touch name */
.dimX .label{
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cadLabel);
  background: var(--cadLabelBg);
  padding: 1px 10px;
  border: 1px solid rgba(233,233,239,0.10);
  border-radius: 6px;
}

/* Dimension line (height) */
.dimY{
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 8px;
  width: 18px;
  pointer-events: none;
  border-left: 1px solid var(--cadLine);
}
.dimY .tick{
  position: absolute;
  left: -7px;
  width: 14px;
  height: 1px;
  background: var(--cadLine);
}
.dimY .tick.top{ top: 0; }
.dimY .tick.bottom{ bottom: 0; }

/* Fix height label so it doesn’t “cover the whole line” */
.dimY .label{
  position: absolute;
  top: 50%;
  left: 6px; /* move label slightly right of the line */
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cadLabel);
  background: var(--cadLabelBg);
  padding: 1px 10px;
  border: 1px solid rgba(233,233,239,0.10);
  border-radius: 6px;
}

/* Sketch handles */
.sketchHandle{
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(58,123,253,0.35), rgba(58,123,253,0.2));
  border: 1px solid rgba(90,155,255,0.95);
  box-shadow: 0 0 0 2px rgba(15,17,21,0.9), 0 0 12px rgba(58,123,253,0.4);
  cursor: nwse-resize;
  opacity: 0.95;
  z-index: 5;
  transform: var(--handleTransform, translate(0, 0));
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.sketchHandle::before{
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(233,233,239,0.8);
  border-radius: 2px;
}
.sketchHandle:hover{
  transform: var(--handleTransform, translate(0, 0)) scale(1.08);
  box-shadow: 0 0 0 2px rgba(15,17,21,0.9), 0 0 16px rgba(58,123,253,0.65);
}
.sketchHandle:active{
  transform: var(--handleTransform, translate(0, 0)) scale(1.02);
}
.sketchHandle:focus-visible{
  outline: 2px solid rgba(150,193,255,0.95);
  outline-offset: 2px;
}

.sketchHandle.tl{
  left: 12px;
  top: 12px;
  --handleTransform: translate(-145%, -145%);
  cursor: nwse-resize;
}
.sketchHandle.tr{
  right: 12px;
  top: 12px;
  --handleTransform: translate(145%, -145%);
  cursor: nesw-resize;
}
.sketchHandle.bl{
  left: 12px;
  bottom: 12px;
  --handleTransform: translate(-145%, 145%);
  cursor: nesw-resize;
}
.sketchHandle.br{
  right: 12px;
  bottom: 12px;
  --handleTransform: translate(145%, 145%);
  cursor: nwse-resize;
}

/* ====== Main Content ====== */
.page{
  padding: 2.5rem 1.25rem 4rem;
  width: min(1000px, 92vw);
  margin: 0 auto;
}

.contentSection{
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--stroke);
}

.contentSection h1{
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.muted{ color: var(--muted); }

.twoCol{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}
@media (max-width: 850px){
  .twoCol{ grid-template-columns: 1fr; }
}

.card{
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 1rem;
}
.cardTitle{
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.bullet{
  margin: 0;
  padding-left: 1.1rem;
}
.bullet li{
  margin: 0.35rem 0;
}

/* Trail / vertical line for hobbies */
.trail{
  position: relative;
  padding-left: 1.25rem;
  margin-top: 1.25rem;
}
.trailLine{
  position: absolute;
  left: 0.35rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: rgba(233,233,239,0.18);
  border-radius: 999px;
}
.trailNode{
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.nodeDot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(58,123,253,0.8);
  background: rgba(58,123,253,0.15);
  margin-top: 0.35rem;
}
.nodeBody h2{
  margin: 0;
  font-size: 1.1rem;
}

/* Anchor spacing so the top header doesn't hide titles */
.anchorSection{
  scroll-margin-top: 220px;
}

.footer{
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* ====== Responsive ====== */
@media (max-width: 900px){
  .sceneTiles{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px){
  .topNav{
    gap: 0.5rem;
    padding: 0.9rem 0.9rem 0.25rem;
  }
  .navItem{
    padding: 0.35rem 0.55rem;
  }
}
