:root {
  --cover: #1f5a2a;
  --cover-2: #174621;
  --gilt: #e4cf8e;
  --ink-1: #2E7D32;
  --ink-2: #2b4c8c;
  --ink-3: #8c2b3e;
  --guil: rgba(61, 134, 68, .09);
  --bronze: #a2643a;
  --silver: #7f8a94;
  --gold: #b88a1c;
  --cell-on: #3d8644;
  --cell-off: #eef3ec;
}
[data-theme="dark"] {
  --cover: #1b4a23; --cover-2: #123318; --gilt: #d9c27d; --ink-1: #5aa862; --ink-2: #7d9bd8; --ink-3: #d37e90;
  --guil: rgba(61, 134, 68, .14); --bronze: #c98a5c; --silver: #aeb7bf; --gold: #d6aa3e; --cell-on: #3d8644; --cell-off: #333733;
}

.tn-page { overflow-x: clip; }
.tn-num { display: inline-block; font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 10px; }
.tn-page h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); line-height: 1.1; }

.tn-hero { position: relative; padding-block: 56px 72px; background: linear-gradient(var(--wash), var(--wash)) left top / 62% 100% no-repeat; }
.tn-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.tn-copy { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.tn-copy h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4.1rem); line-height: 1.05; }
.tn-lead { margin: 0; font-size: 1.075rem; line-height: 1.6; color: var(--fg-2); max-width: 34em; }
.tn-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.tn-facts { list-style: none; margin: 4px 0 0; padding: 18px 0 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--fg-2); }
.tn-facts b { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }

.tn-visual { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tn-pp-stage { position: relative; width: min(600px, 100%); aspect-ratio: 1.42; perspective: 1800px; }
.tn-pp-book { position: absolute; left: 50%; top: 0; width: 50%; height: 100%; transform: translateX(-50%); transition: transform 1.1s cubic-bezier(.6, .05, .25, 1); transform-style: preserve-3d; }
.tn-pp-stage.open .tn-pp-book { transform: translateX(0); }
.tn-pp-page, .tn-pp-cover { position: absolute; inset: 0; border-radius: 4px 12px 12px 4px; }
.tn-pp-page { background: var(--paper); border: 1px solid var(--border); box-shadow: 0 18px 36px -24px var(--shadow); overflow: hidden; padding: 9% 8%; display: flex; flex-direction: column; justify-content: space-between; }
.tn-pp-guilloche { position: absolute; inset: 0; pointer-events: none; background:
  repeating-radial-gradient(circle at 20% 110%, transparent 0 7px, var(--guil) 7px 8px),
  repeating-radial-gradient(circle at 90% -10%, transparent 0 9px, var(--guil) 9px 10px); }
.tn-pp-holder-top { position: relative; display: grid; grid-template-columns: 34% minmax(0, 1fr); gap: 8%; align-items: start; }
.tn-pp-photo { aspect-ratio: 5 / 6; border: 1px solid var(--border); border-radius: 3px; background: var(--wash-2); color: var(--fg-2); display: grid; place-items: end center; overflow: hidden; }
.tn-pp-photo svg { width: 80%; opacity: .55; }
.tn-pp-fields { margin: 0; display: grid; gap: 6px; font-size: clamp(9px, 1.6vw, 12px); }
.tn-pp-fields dt { font-family: var(--mono); font-size: .78em; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); }
.tn-pp-fields dd { margin: 0; font-weight: 500; color: var(--fg); line-height: 1.25; }
.tn-pp-status { color: var(--accent-text) !important; transition: color .3s ease; }
.tn-pp-mrz { position: relative; display: grid; gap: 2px; font-family: var(--mono); font-size: clamp(7px, 1.25vw, 10.5px); letter-spacing: .08em; color: var(--fg); opacity: .8; white-space: nowrap; overflow: hidden; border-top: 1px dashed var(--border); padding-top: 6%; }

.tn-pp-cover { transform-origin: left center; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.6, .05, .25, 1); z-index: 2; }
.tn-pp-stage.open .tn-pp-cover { transform: rotateY(-180deg); }
.tn-pp-face { position: absolute; inset: 0; border-radius: inherit; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tn-pp-front { background:
  radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .07), transparent 60%),
  linear-gradient(var(--cover), var(--cover-2)); color: var(--gilt);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%; text-align: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), inset 6px 0 10px -6px rgba(0, 0, 0, .5), 0 22px 40px -24px rgba(0, 0, 0, .6); }
.tn-pp-emblem { width: 46%; }
.tn-pp-country { font-family: var(--mono); font-size: clamp(9px, 1.6vw, 12.5px); letter-spacing: .32em; text-transform: uppercase; }
.tn-pp-title { font-family: var(--display); font-size: clamp(16px, 3.1vw, 25px); line-height: 1.1; }
.tn-pp-word { font-family: var(--mono); font-size: clamp(8px, 1.4vw, 11px); letter-spacing: .4em; text-transform: uppercase; opacity: .8; border-top: 1px solid currentColor; padding-top: 4%; }
.tn-pp-back { transform: rotateY(180deg); background: var(--paper); border: 1px solid var(--border); border-radius: 12px 4px 4px 12px; overflow: hidden; padding: 10% 9%; display: flex; flex-direction: column; justify-content: space-between; }
.tn-pp-back-note { position: relative; margin: 0; font-family: var(--display); font-size: clamp(12px, 2.2vw, 17px); line-height: 1.3; color: var(--fg); }
.tn-pp-mini-stamps { position: relative; display: flex; flex-wrap: wrap; gap: 6%; justify-content: center; }
.tn-mini { width: 27%; aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed var(--border); display: grid; place-items: center; font-family: var(--mono); font-size: clamp(7px, 1.3vw, 10px); letter-spacing: .1em; text-transform: uppercase; color: transparent; transition: color .2s ease; }
.tn-mini.on { border: 3px double currentColor; animation: thunk .45s cubic-bezier(.2, .9, .3, 1.25) both; }
.tn-mini[data-i="0"].on { color: var(--ink-1); transform: rotate(-10deg); }
.tn-mini[data-i="1"].on { color: var(--ink-2); transform: rotate(8deg); }
.tn-mini[data-i="2"].on { color: var(--ink-3); transform: rotate(-4deg); }
.tn-open { font: inherit; font-size: 14px; font-weight: 500; color: var(--fg); background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.tn-open:hover { border-color: var(--green); color: var(--green); }

.tn-stages { padding-block: 88px; background: var(--bg-2); }
.tn-head { max-width: 640px; margin-bottom: 40px; }
.tn-head p { color: var(--fg-2); margin: 12px 0 0; }
.tn-visa-pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; counter-reset: v; }
.tn-visa { position: relative; overflow: hidden; background: var(--paper); border: 1px solid var(--border); border-radius: 4px; padding: 26px 24px 120px; box-shadow: 0 16px 30px -26px var(--shadow); }
.tn-visa-top { position: relative; display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); border-bottom: 1px dashed var(--border); padding-bottom: 10px; margin-bottom: 16px; }
.tn-visa h3 { position: relative; font-size: 1.45rem; line-height: 1.15; margin-bottom: 14px; }
.tn-visa-list { position: relative; margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 14.5px; color: var(--fg-2); }
.tn-visa-list li { padding-left: 16px; position: relative; }
.tn-visa-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 1.5px; background: var(--green); }

.tn-stamp { position: absolute; right: 22px; bottom: 22px; width: 118px; height: 118px; border-radius: 50%; border: 4px double currentColor; display: grid; place-content: center; text-align: center; gap: 2px; font-family: var(--mono); text-transform: uppercase; opacity: 0; transform: rotate(var(--r)) scale(1.9);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.tn-stamp b { font-size: 15px; letter-spacing: .14em; }
.tn-stamp i { font-style: normal; font-size: 10.5px; letter-spacing: .2em; border-top: 1px solid currentColor; padding-top: 3px; }
.tn-stamp.tn-s1 { color: var(--ink-1); }
.tn-stamp.tn-s2 { color: var(--ink-2); border-radius: 10px; width: 132px; height: 92px; }
.tn-stamp.tn-s3 { color: var(--ink-3); border-style: dashed; border-width: 2.5px; }
.tn-visa.stamped .tn-stamp { animation: thunk .5s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes thunk {
  0% { opacity: 0; transform: rotate(var(--r, 0deg)) scale(1.9); }
  60% { opacity: .95; transform: rotate(var(--r, 0deg)) scale(.94); }
  100% { opacity: .9; transform: rotate(var(--r, 0deg)) scale(1); }
}
.tn-mini[data-i="0"] { --r: -10deg; }
.tn-mini[data-i="1"] { --r: 8deg; }
.tn-mini[data-i="2"] { --r: -4deg; }

.tn-ladder { padding-block: 88px; }
.tn-ladder-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.tn-ladder-copy p { color: var(--fg-2); max-width: 32em; }
.tn-ladder-form { margin-top: 22px; display: grid; gap: 12px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); }
.tn-ladder-form label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.tn-ladder-form input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.tn-refs { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; padding-block: 4px; border-block: 1px dashed var(--border); }
.tn-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.tn-stepper button { font: inherit; width: 36px; height: 34px; border: 0; background: transparent; color: var(--fg); cursor: pointer; font-size: 18px; }
.tn-stepper button:hover { color: var(--green); }
.tn-stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.tn-seals { display: grid; gap: 14px; }
.tn-seal { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 18px; align-items: center; padding: 10px 14px; border-radius: 8px; opacity: .38; filter: grayscale(1); transition: opacity .4s ease, filter .4s ease, background-color .4s ease; }
.tn-seal svg { width: 84px; height: 84px; }
.tn-seal-edge { fill: none; stroke: currentColor; stroke-width: 6; stroke-dasharray: 3 3.2; }
.tn-seal-in { fill: currentColor; opacity: .18; stroke: currentColor; stroke-width: 1.5; }
.tn-seal.tn-bronze { color: var(--bronze); }
.tn-seal.tn-silver { color: var(--silver); }
.tn-seal.tn-gold { color: var(--gold); }
.tn-seal-text b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--fg); }
.tn-seal-text span { font-size: 14px; color: var(--fg-2); }
.tn-seal.on { opacity: 1; filter: none; background: var(--wash-2); }
.tn-seal.on svg { animation: sealpop .5s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes sealpop { 0% { transform: scale(.8) rotate(-20deg); } 100% { transform: none; } }
.tn-seal-result { margin: 4px 0 0; font-size: 15px; color: var(--fg-2); }
.tn-seal-result b { color: var(--fg); }

.tn-week { padding-block: 88px; background: var(--bg-2); }
.tn-week-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.tn-week-copy p { color: var(--fg-2); max-width: 30em; }
.tn-tz { font-size: 14px; }
.tn-tz b { color: var(--fg); font-family: var(--mono); font-weight: 400; }
.tn-tally { display: flex; align-items: baseline; gap: 10px; margin: 18px 0; }
.tn-tally-num { font-family: var(--display); font-size: 4rem; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.tn-tally-unit { font-size: 15px; color: var(--fg-2); }
.tn-week-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tn-chip { font: inherit; font-size: 13.5px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper); color: var(--fg); cursor: pointer; }
.tn-chip:hover { border-color: var(--green); color: var(--green); }
.tn-week-sheet { min-width: 0; background: var(--paper); border: 1px solid var(--border); border-radius: 6px; padding: 14px 14px 16px 8px; box-shadow: 0 16px 30px -26px var(--shadow); }
.tn-week-days, .tn-week-body { display: grid; grid-template-columns: 42px repeat(7, minmax(0, 1fr)); gap: 0 4px; }
.tn-week-days { margin-bottom: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--fg-2); text-align: center; }
.tn-week-body { grid-template-columns: 42px minmax(0, 1fr); }
.tn-week-hours { display: grid; grid-template-rows: repeat(32, 11px); gap: 2px 0; font-family: var(--mono); font-size: 10.5px; color: var(--fg-2); }
.tn-week-hours span { grid-row: span 2; line-height: 1; transform: translateY(-3px); }
.tn-week-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(32, 11px); grid-auto-flow: column; gap: 2px 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tn-cell { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 2px; background: var(--cell-off); cursor: pointer; transition: background-color .12s ease; }
.tn-cell.on { background: var(--cell-on); }
.tn-cell:focus-visible { outline: 2px solid var(--highlight); outline-offset: 1px; }

.tn-review { padding-block: 88px; }
.tn-review-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.tn-review-notes { display: grid; gap: 0; }
.tn-review-notes p { margin: 0; padding: 16px 0; border-top: 1px solid var(--border); font-size: 1.05rem; line-height: 1.55; }
.tn-review-notes p:last-child { border-bottom: 1px solid var(--border); }

.tn-final { padding-block: 80px 96px; background: var(--wash); }
.tn-final-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.tn-final-inner p { margin: 0; color: var(--fg-2); }
.tn-final-mrz { margin-top: 28px; max-width: 100%; overflow: hidden; white-space: nowrap; font-family: var(--mono); font-size: clamp(11px, 2.2vw, 17px); letter-spacing: .18em; color: var(--fg); opacity: .55; }

@media (max-width: 960px) {
  .tn-hero { background-size: 100% 58%; }
  .tn-hero-grid, .tn-ladder-grid, .tn-week-grid, .tn-review-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .tn-visa-pages { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .tn-hero { padding-block: 36px 56px; }
  .tn-stages, .tn-ladder, .tn-week, .tn-review { padding-block: 64px; }
  .tn-seal { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .tn-seal svg { width: 64px; height: 64px; }
  .tn-week-days, .tn-week-body { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 0 3px; }
  .tn-week-body { grid-template-columns: 34px minmax(0, 1fr); }
  .tn-week-cells { gap: 2px 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-pp-book, .tn-pp-cover { transition: none; }
  .tn-visa.stamped .tn-stamp, .tn-mini.on, .tn-seal.on svg { animation: none; opacity: .9; transform: rotate(var(--r, 0deg)); }
  .tn-seal { transition: none; }
}
