:root{
  --paper:#fbf6ef;
  --paper2:#f5ede3;
  --ink:#1c1411;
  --muted:#5a4a43;
  --muted2:#7a655c;

  --line: rgba(28, 20, 17, .14);
  --shadow: 0 14px 40px rgba(0,0,0,.10);
  --shadow2: 0 10px 22px rgba(0,0,0,.10);

  --accent:#ff7a3d;   /* warm orange */
  --accent2:#ffd166;  /* warm yellow */
  --accent3:#ff4d6d;  /* warm rose */
  --radius: 18px;
  --radius2: 22px;

  --max: 1120px;
  --pad: 22px;
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--ink);
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(255, 209, 102, .34), transparent 60%),
    radial-gradient(900px 520px at 92% 8%, rgba(255, 122, 61, .18), transparent 58%),
    radial-gradient(900px 520px at 60% 110%, rgba(255, 77, 109, .10), transparent 62%),
    linear-gradient(180deg, var(--paper), var(--paper2));
  line-height:1.65;
  overflow-x:hidden;
}

a{color:inherit}
.wrap{width:min(var(--max), calc(100% - 2*var(--pad))); margin:0 auto}
main{padding-bottom:36px}

/* Subtle paper grain */
.grain:before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity:.10;
  mix-blend-mode:multiply;
  z-index:0;
}

/* Header */
header{
  position:sticky; top:0; z-index:60;
  background: rgba(251, 246, 239, .78);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--line);
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
  gap:12px;
}
.brand{
  display:flex; align-items:center; gap:12px;
  font-weight:950;
  letter-spacing:-.2px;
  text-decoration:none;
  white-space:nowrap;
}
.mark{
  width:32px;
  height:32px;
  border-radius:12px;
  background: url("assets/logo-mark.png") center / cover no-repeat;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
  flex: 0 0 auto;
}
.brand small{ font-weight:850; color:var(--muted2); letter-spacing:.2px; }

.navlinks{
  display:flex; align-items:center; gap:12px;
  list-style:none; padding:0; margin:0;
}
.navlinks a{
  text-decoration:none;
  font-weight:900;
  font-size:14px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
}
.navlinks a:hover{ border-color: var(--line); background: rgba(255,255,255,.55); }

.btn{
  appearance:none;
  border:1px solid var(--line);
  background: rgba(255,255,255,.55);
  color:var(--ink);
  border-radius:999px;
  padding:10px 14px;
  font-weight:950;
  font-size:14px;
  cursor:pointer;
  display:inline-flex; align-items:center; gap:10px;
  text-decoration:none;
  box-shadow: var(--shadow2);
  transition: transform .08s ease, background .15s ease;
}
.btn:hover{background: rgba(255,255,255,.78)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  border-color: rgba(255, 122, 61, .35);
  background: linear-gradient(135deg, rgba(255,122,61,.92), rgba(255,209,102,.80));
}
.btn.primary:hover{background: linear-gradient(135deg, rgba(255,122,61,.98), rgba(255,209,102,.88))}
.btn.ghost{ background: transparent; box-shadow:none; }

.menuBtn{display:none}
@media (max-width: 820px){
  .navlinks{display:none}
  .menuBtn{display:inline-flex}
}

/* Mobile menu */
.menuOverlay{
  position:fixed; inset:0;
  background: rgba(251, 246, 239, .92);
  backdrop-filter: blur(10px);
  display:none;
  z-index:200;
}
.menuInner{ width:min(var(--max), calc(100% - 2*var(--pad))); margin:0 auto; padding:18px 0 40px; }
.menuTop{ display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.menuList{ list-style:none; padding:0; margin:18px 0 0; display:grid; gap:10px; }
.menuList a{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: rgba(255,255,255,.56);
  text-decoration:none;
  font-weight:950;
  font-size:18px;
}

/* Hero */
.hero{padding: 54px 0 12px; position:relative; z-index:1}
.heroGrid{ display:grid; grid-template-columns: 1.2fr .8fr; gap:16px; align-items:stretch; }
@media (max-width: 980px){ .heroGrid{grid-template-columns:1fr} }

.panel{
  background: rgba(255,255,255,.58);
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}
.panelInner{padding:22px}
.kicker{
  display:inline-flex; align-items:center; gap:10px;
  text-transform:uppercase;
  font-weight:950;
  letter-spacing:.3px;
  font-size:12px;
  color:var(--muted2);
}
.dot{
  width:8px; height:8px; border-radius:50%;
  background: var(--accent2);
  box-shadow: 0 0 0 4px rgba(255,209,102,.22);
}
h1{
  margin:12px 0 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height:1.06;
  letter-spacing:-.8px;
}
.lead{
  margin:0 0 14px;
  color:var(--muted);
  font-weight:750;
  max-width: 68ch;
  font-size: 16px;
}
.hl{
  background: linear-gradient(0deg, rgba(255,209,102,.65), rgba(255,209,102,.65));
  padding: 0 .22em;
  border-radius: 10px;
}
.btnRow{display:flex; gap:12px; flex-wrap:wrap; margin-top:14px}
.note{
  margin-top:14px;
  padding:14px 14px 12px;
  border-radius: var(--radius2);
  border:1px dashed rgba(28,20,17,.26);
  background: rgba(255,255,255,.55);
}
.note strong{font-weight:950}
.note p{margin:8px 0 0; color:var(--muted); font-weight:720}

ul.clean{
  margin:10px 0 0;
  padding-left: 18px;
  color:var(--muted);
  font-weight:720;
  font-size:14px;
}
ul.clean li{margin:6px 0}

.signature{ display:flex; align-items:center; gap:12px; margin-top:12px; }
.sigMark{
  width:52px; height:52px; border-radius: 18px;
  border:1px solid rgba(28,20,17,.14);
  background:
    radial-gradient(20px 20px at 30% 35%, rgba(0,0,0,.08), transparent 60%),
    linear-gradient(135deg, rgba(255,122,61,.60), rgba(255,209,102,.58));
  display:grid; place-items:center;
  font-weight:950;
}
.smallMuted{margin:0; color:var(--muted2); font-weight:780; font-size:13px}

/* Sections */
.section{padding: 26px 0; position:relative; z-index:1}
.sectionTitle{display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:12px}
h2{margin:0; font-size:22px; letter-spacing:-.25px}
.hint{color:var(--muted2); font-weight:780; font-size:13px}

/* Mosaic grid */
.mosaic{ display:grid; grid-template-columns: repeat(12, 1fr); gap:12px; }
.tile{
  grid-column: span 4;
  min-height: 150px;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background: rgba(255,255,255,.62);
  box-shadow: var(--shadow2);
  overflow:hidden;
  position:relative;
  text-decoration:none;
  display:block;
  transform: translateZ(0);
}
.tile:hover{ transform: translateY(-1px); }
.tileInner{
  padding:16px;
  position:relative;
  height:100%;
  display:flex; flex-direction:column;
  gap:10px;
}
.tile h3{margin:0; font-size:16px; letter-spacing:-.1px}
.tile p{margin:0; color:var(--muted); font-weight:720; font-size:14px}
.tile .meta{margin-top:auto; color:var(--muted2); font-weight:850; font-size:12px}
@media (max-width: 980px){ .tile{grid-column: span 6} }
@media (max-width: 620px){ .tile{grid-column: span 12} }

.tile.colorA{background: linear-gradient(135deg, rgba(255,209,102,.74), rgba(255,255,255,.68))}
.tile.colorB{background: linear-gradient(135deg, rgba(255,122,61,.34), rgba(255,255,255,.68))}
.tile.colorC{background: linear-gradient(135deg, rgba(255,77,109,.22), rgba(255,255,255,.68))}

/* Timeline */
.timeline{display:grid; gap:12px}
.item{
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background: rgba(255,255,255,.60);
  box-shadow: var(--shadow2);
  padding: 16px;
}
.itemTop{display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; align-items:baseline}
.role{font-weight:950}
.when{color:var(--muted2); font-weight:850; font-size:13px}

/* Footer */
footer{
  border-top:1px solid var(--line);
  padding: 28px 0 40px;
  color:var(--muted2);
  position:relative; z-index:1;
}
.footRow{display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; align-items:center}
.small{font-size:13px; font-weight:780}

/* Game modal */
.modalBackdrop{
  position:fixed; inset:0;
  display:none;
  align-items:center; justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(8px);
  z-index:250;
}
.modal{
  width:min(1100px, 100%);
  background: rgba(255,255,255,.92);
  border:1px solid rgba(28,20,17,.18);
  border-radius: 24px;
  overflow:hidden;
  box-shadow: 0 22px 80px rgba(0,0,0,.30);
}
.modalHead{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:12px 14px;
  border-bottom:1px solid rgba(28,20,17,.14);
  background: rgba(255,255,255,.80);
}
.modalTitle{font-weight:950}
.modalBody{height: min(74vh, 820px); background:#000}
.modalBody iframe{width:100%; height:100%; border:0; display:block; background:#000}

/* ===================== Falling animation (scroll-trigger) ===================== */
@keyframes ecFallFromTop {
  0%   { opacity:0; transform: translateY(var(--fall-from)) rotate(-1.8deg) scale(.985); }
  60%  { opacity:1; transform: translateY(16px) rotate(.8deg)  scale(1.01); }
  78%  { transform: translateY(-7px) rotate(-.25deg) scale(1.0); }
  100% { opacity:1; transform: translateY(0) rotate(0) scale(1); }
}
@keyframes ecRiseIn {
  0%   { opacity:0; transform: translateY(22px); }
  100% { opacity:1; transform: translateY(0); }
}

/* Only hide if JS is enabled AND not revealed yet */
html.js .tile[data-fall]:not(.in):not(.done){ opacity:0; }
html.js .item[data-fall]:not(.in):not(.done){ opacity:0; transform: translateY(18px); }

.tile.in{
  animation: ecFallFromTop 1.05s cubic-bezier(.15,.85,.2,1) both;
  animation-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}
.item.in{
  animation: ecRiseIn .65s cubic-bezier(.2,.9,.2,1) both;
  animation-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}

/* Lock final state */
.tile.done, .item.done{
  opacity:1 !important;
  transform:none !important;
  animation:none !important;
}

/* Ensure inner content never animates separately */
.tile .tileInner{ animation: none !important; }

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  html.js .tile[data-fall], html.js .item[data-fall]{ opacity:1 !important; transform:none !important; }
  .tile.in, .item.in{ animation:none !important; }
}

/* Focus */
:focus-visible{
  outline: 3px solid rgba(255,122,61,.55);
  outline-offset: 3px;
  border-radius: 12px;
}



/* ===================== Mobile polish ===================== */
.brand > span:last-child{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}
.brand small{ display:block; font-size:12px; margin-top:2px; }
@media (max-width: 420px){
  .brand small{ display:none; }
}

@media (max-width: 620px){
  :root{ --pad: 16px; }
  .hero{ padding: 38px 0 8px; }
  .panelInner{ padding: 18px; }
  .btnRow{ gap:10px; }
  .btnRow .btn{ width:100%; justify-content:center; }
  .note{ padding: 12px 12px 10px; }
  .tile{ min-height: 140px; }
  .tileInner{ padding: 14px; }
  h1{ letter-spacing:-.6px; }
}

/* Avoid hover-jitter on touch devices */
@media (hover: none){
  .tile:hover{ transform: none; }
  .btn:hover{ transform: none; }
}

/* Reduce grain intensity on mobile for performance */
@media (max-width: 620px){
  .grain:before{ opacity: .06; }
}

/* Use stable viewport units where available (iOS) */
:root{ --fall-from: -120vh; }
@supports (height: 100svh){
  :root{ --fall-from: -120svh; }
}

/* ===================== Resume blocks ===================== */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.58);
  font-weight:900;
  font-size:13px;
  color: var(--muted);
}
.chip .miniDot{
  width:8px; height:8px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,122,61,.18);
}
.subsection{
  margin-top: 14px;
}
.subsection h3{
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -.1px;
}
