/* ---------------------------------------------------------------- layout */

.app { padding: var(--s-5); display: grid; gap: var(--s-5); }
.shell-phone .app { padding: var(--s-4); gap: var(--s-4); }

.app-head { display: grid; gap: var(--s-2); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.app-title {
  font-size: clamp(24px, 4.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.app-sub { color: var(--ink-2); max-width: 62ch; }

.divider { height: 1px; background: var(--glass-line-soft); border: 0; }

.card {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--glass-line-soft);
  border: 1px solid var(--glass-line-soft);
}

.grid-2 { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-3 { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------------------------------------------------------------- about */

.hero {
  display: grid;
  gap: var(--s-4);
  justify-items: start;
  padding: var(--s-5) 0 var(--s-2);
}
.hero .avatar { width: 66px; height: 66px; font-size: 23px; }
.hero-thesis {
  font-size: clamp(19px, 3.2vw, 27px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.28;
  max-width: 22ch;
  background: linear-gradient(100deg, var(--ink) 30%, var(--amp) 70%, var(--phase));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-bio { color: var(--ink-2); max-width: 60ch; }

.spec-list { display: grid; gap: 0; }
.spec-row {
  display: flex;
  gap: var(--s-4);
  padding: 11px 0;
  border-bottom: 1px solid var(--glass-line-soft);
  font-size: 13.5px;
}
.spec-row:last-child { border-bottom: 0; }
.spec-key { flex: none; width: 118px; color: var(--ink-3); }
.spec-val { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- projects */

.proj-list { display: grid; gap: var(--s-3); }
.proj {
  width: 100%;
  text-align: left;
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--glass-line-soft);
  background: var(--glass-line-soft);
  transition: transform 0.25s var(--spring), border-color 0.25s, background 0.25s;
}
.proj:hover, .proj:focus-visible {
  transform: translateY(-2px);
  border-color: var(--glass-line);
  background: var(--glass-line);
}
.proj:active { transform: translateY(0) scale(0.995); }
.proj-top { display: flex; align-items: center; gap: var(--s-3); }
.proj-mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  display: grid; place-content: center;
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700; color: #fff;
}
.mark--lime { background: linear-gradient(180deg, #46a0ff, #0a63d8); color: #fff; }
.mark--cyan { background: linear-gradient(180deg, #6fd9ff, #0a84ff); color: #04211d; }
.mark--mono { background: linear-gradient(160deg, #ffffff, #c6cfdd); color: #10182a; }
.mark--night { background: linear-gradient(180deg, #3a4152, #14181f); color: #eef2f9; }
.proj-name { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; }
.proj-kind { font-size: 12px; color: var(--ink-3); }
.proj-year {
  margin-left: auto; flex: none;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}
.proj-tag { color: var(--ink-2); font-size: 13.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-line-soft);
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s-3); }
.metric { display: grid; gap: 1px; }
.metric-value {
  font-family: var(--font-mono);
  font-size: clamp(17px, 2.6vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}

.prose { display: grid; gap: var(--s-3); color: var(--ink-2); max-width: 66ch; }
.prose p { line-height: 1.62; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--glass-line);
  background: var(--glass-line-soft);
  transition: transform 0.2s var(--spring), background 0.2s;
}
.btn:hover { background: var(--glass-line); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: linear-gradient(135deg, var(--amp), #4a6fe0);
  border-color: transparent; color: #fff;
}
.btn--primary:hover { filter: brightness(1.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---------------------------------------------------------------- timeline */

.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--s-4);
  padding-bottom: var(--s-5);
}
.tl-rail { position: relative; }
.tl-dot {
  position: absolute; top: 5px; left: 2px;
  width: 10px; height: 10px;
  border-radius: var(--r-pill);
  background: var(--ink-3);
}
.tl-item.is-current .tl-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(40, 200, 64, 0.16);
}
.tl-rail::after {
  content: ""; position: absolute;
  top: 20px; bottom: -8px; left: 6.5px;
  width: 1px; background: var(--glass-line-soft);
}
.tl-item:last-child .tl-rail::after { display: none; }
.tl-body { display: grid; gap: 5px; }
.tl-role { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.tl-org { font-size: 13px; color: var(--ink-2); }
.tl-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.tl-detail { display: grid; gap: 4px; margin-top: 4px; }
.tl-detail li {
  position: relative; padding-left: 15px;
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.tl-detail li::before {
  content: ""; position: absolute; left: 3px; top: 8.5px;
  width: 4px; height: 4px; border-radius: var(--r-pill);
  background: var(--ink-3);
}

.seg {
  display: flex; gap: 2px; padding: 2px;
  border-radius: var(--r-sm);
  background: var(--glass-line-soft);
  border: 1px solid var(--glass-line-soft);
  width: fit-content;
  max-width: 100%;
  overflow: auto;
}
.seg button {
  padding: 6px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 550; white-space: nowrap;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
}
.seg button[aria-pressed="true"] {
  background: var(--glass-strong); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ---------------------------------------------------------------- certs */

.cert {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--glass-line-soft);
  background: var(--glass-line-soft);
}
.cert-seal {
  width: 34px; height: 34px; flex: none;
  border-radius: var(--r-pill);
  display: grid; place-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(150deg, var(--amp), var(--phase));
}
.cert-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cert-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.cert-meta { font-size: 11.5px; color: var(--ink-3); }
.cert-id {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- skills */

.skill-group { display: grid; gap: var(--s-3); }
.skill-group-name {
  font-size: 12px; font-weight: 650;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-3);
}
.skill { display: grid; gap: 5px; }
.skill-top { display: flex; justify-content: space-between; gap: var(--s-3); font-size: 13px; }
.skill-level { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.meter {
  height: 4px; border-radius: var(--r-pill);
  background: var(--glass-line-soft); overflow: hidden;
}
.meter span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--amp), var(--phase));
  transform-origin: left;
  animation: meter-in 0.8s var(--ease-out) both;
}
@keyframes meter-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- terminal */

.term {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: var(--s-4);
  min-height: 100%;
  background: rgba(4, 7, 14, 0.6);
  color: #cfe3ff;
  display: grid;
  align-content: start;
  gap: 2px;
}
html[data-theme="light"] .term { background: rgba(255, 255, 255, 0.6); color: #1b2740; }
.term-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-line.is-cmd { color: var(--ink); }
.term-line.is-err { color: #ff8f88; }
.term-line.is-ok { color: #6ee787; }
.term-prompt { color: var(--phase); }
.term-input-row { display: flex; gap: 7px; align-items: baseline; }
.term-input {
  flex: 1; background: none; border: 0; outline: none;
  font: inherit; color: var(--ink); caret-color: var(--amp);
}

/* ---------------------------------------------------------------- contact */

.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%;
  padding: 11px var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-line);
  background: var(--glass-line-soft);
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--amp);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.2);
}
textarea.input { min-height: 118px; resize: vertical; line-height: 1.55; }
.hp { position: absolute; left: -9999px; opacity: 0; }
.form-note { font-size: 12px; color: var(--ink-3); }
.form-msg { font-size: 13px; font-weight: 550; min-height: 1.2em; }
.form-msg.is-ok { color: #56d364; }
.form-msg.is-err { color: #ff8f88; }

/* ---------------------------------------------------------------- settings */

.setting-row {
  display: flex; align-items: center; gap: var(--s-4);
  padding: 13px 0;
  border-bottom: 1px solid var(--glass-line-soft);
}
.setting-row:last-child { border-bottom: 0; }
.setting-text { flex: 1; display: grid; gap: 2px; }
.setting-name { font-size: 14px; font-weight: 550; }
.setting-hint { font-size: 12px; color: var(--ink-3); }

.switch {
  flex: none;
  width: 50px; height: 30px;
  border-radius: var(--r-pill);
  background: var(--glass-line);
  padding: 2px;
  transition: background 0.28s var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--green); }
.switch i {
  display: block;
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.28s var(--spring);
}
.switch[aria-checked="true"] i { transform: translateX(20px); }

/* ---------------------------------------------------------------- error */

.error-page {
  position: fixed; inset: 0;
  display: grid; place-content: center; justify-items: center;
  gap: var(--s-4); padding: var(--s-5);
  text-align: center;
  background:
    radial-gradient(90% 70% at 50% 0%, var(--ground-2), var(--ground-0) 70%);
}
.error-badge {
  width: 74px; height: 74px;
  border-radius: var(--r-lg);
  display: grid; place-content: center;
  font-family: var(--font-mono);
  font-size: 21px; font-weight: 700; color: #fff;
  background: linear-gradient(150deg, var(--amp), var(--phase));
  box-shadow: 0 14px 40px rgba(91, 140, 255, 0.3);
}
.error-code { font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.2em; color: var(--ink-3); text-transform: uppercase; }
.error-title { font-size: clamp(25px, 5vw, 36px); font-weight: 700; letter-spacing: -0.03em; }
.error-msg { color: var(--ink-2); max-width: 44ch; }

/* ---------------------------------------------------------------- misc */

.empty {
  padding: var(--s-7) var(--s-4);
  text-align: center;
  color: var(--ink-3);
  display: grid; gap: var(--s-2); justify-items: center;
}
.loading {
  padding: var(--s-7); display: grid; place-items: center;
}
.spinner {
  width: 22px; height: 22px;
  border-radius: var(--r-pill);
  border: 2px solid var(--glass-line);
  border-top-color: var(--amp);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- v2 */

.fade-in { animation: fade-up .42s var(--ease-out) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.ico { flex: none; }
.brand { flex: none; fill: currentColor; }

.avatar--photo { object-fit: cover; border: 1px solid var(--glass-edge); }

/* real logos, on a glass plate so light and dark marks both stay legible */
.org-mark, .cert-seal, .proj-mark {
  display: grid; place-content: center; flex: none; overflow: hidden;
}
.org-mark--img, .cert-seal--img, .proj-mark--img {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .28);
}
.org-mark--img img, .cert-seal--img img, .proj-mark--img img {
  width: 100%; height: 100%; object-fit: contain; padding: 12%;
}
.org-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--glass-line-soft); font-size: 11px; font-weight: 700;
  color: var(--ink-2);
}
.tl-head { display: flex; align-items: center; gap: var(--s-3); }
.tl-head > span { min-width: 0; }
.proj-mark--img { border-radius: 11px; }
.cert-seal--img { border-radius: var(--r-pill); }

/* skills, with the official brand mark tinting each row */
.skill-grid { display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.skill {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--glass-line-soft);
  background: var(--glass-line-soft);
  transition: border-color .25s, transform .25s var(--spring);
}
.skill:hover { transform: translateY(-2px); border-color: var(--glass-line); }
.skill-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: grid; place-content: center;
  background: color-mix(in srgb, var(--tint, var(--lime)) 18%, transparent);
  color: var(--tint, var(--lime));
}
html[data-theme="light"] .skill-mark { background: color-mix(in srgb, var(--tint, var(--lime)) 14%, #fff); }
.skill-mark-fallback { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.skill-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.skill-top { display: flex; justify-content: space-between; gap: var(--s-2); font-size: 13px; }
.meter span { background: linear-gradient(90deg, var(--tint, var(--lime)), var(--lime-hi)); }

/* in-OS browser */
.browser { display: flex; flex-direction: column; height: 100%; min-height: 340px; }
.browser-bar {
  flex: none; display: flex; align-items: center; gap: var(--s-2);
  padding: 8px 10px; border-bottom: 1px solid var(--glass-line-soft);
}
.browser-btn {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-content: center; color: var(--ink-2);
  border: 1px solid transparent; transition: background .18s, color .18s;
}
.browser-btn:hover { background: var(--glass-line); color: var(--ink); text-decoration: none; }
.browser-url {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--glass-line-soft); border: 1px solid var(--glass-line-soft);
  font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.browser-stage { flex: 1; position: relative; background: #fff; }
html[data-theme="dark"] .browser-stage { background: #0b1018; }
.browser-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.browser-fallback { position: absolute; inset: 0; display: grid; place-content: center;
  padding: var(--s-5); background: var(--glass-solid); }
.fb-inner { display: grid; gap: var(--s-3); justify-items: center; text-align: center;
  max-width: 44ch; color: var(--ink-2); }
.fb-inner h3 { font-size: 17px; font-weight: 650; color: var(--ink); }
.fb-inner .ico { color: var(--lime); }

/* software keyboard: lift the composer clear of it */
.kb-open .sheet-body { padding-bottom: calc(var(--kb, 0px) + 24px); }
.kb-open #homedock, .kb-open .home-indicator, .kb-open .scene-tag { display: none; }

/* nothing may sit invisible on any theme */
.btn, .chip, .seg button, .spec-val, .tl-detail li, .proj-tag, .app-sub,
.cert-meta, .metric-label, .form-note, .setting-hint { color: var(--ink-2); }
.eyebrow, .tl-meta, .cert-id, .proj-kind, .proj-year, .skill-level { color: var(--ink-3); }
a:hover { color: var(--lime-hi); }
html[data-theme="light"] a:hover { color: var(--lime-lo); }
.btn:hover { border-color: var(--lime); color: var(--ink); }
.btn--primary { color: #0a1400; }
html[data-theme="light"] .btn--primary { color: #fff; }
.btn--primary:hover { color: #0a1400; }
html[data-theme="light"] .btn--primary:hover { color: #fff; }
.spot-row[aria-selected="true"], .spot-row:hover { color: #0a1400; }
html[data-theme="light"] .spot-row[aria-selected="true"],
html[data-theme="light"] .spot-row:hover { color: #fff; }

/* no control may collide with its container */
.btn-row { margin-top: var(--s-2); }
.app > .btn-row:last-child { margin-bottom: var(--s-4); }
.window-body, .sheet-body { scrollbar-gutter: stable; }

.empty .btn { margin-top: var(--s-2); }


/* macOS controls: filled blue primary, tinted secondary, sheet-style fields */
.btn {
  background: var(--sys-fill);
  border: 1px solid transparent;
  color: var(--ink);
  border-radius: 8px;
  font-weight: 590;
}
.btn:hover { background: var(--sys-fill-hover); color: var(--ink); border-color: transparent; }
.btn:active { transform: scale(.975); }
.btn--primary, .btn--primary:hover {
  background: var(--sys-blue); color: #fff; border-color: transparent;
}
.btn--primary:hover { background: var(--sys-blue-press); }
.btn--primary .ico { color: #fff; }

.input {
  background: var(--sys-field);
  border: 1px solid var(--sys-field-line);
  border-radius: 7px;
  font-size: 16px;              /* 16px stops iOS zooming the page on focus */
  color: var(--ink);
}
.input::placeholder { color: var(--ink-3); }
.input:focus {
  border-color: var(--sys-blue);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--sys-blue) 28%, transparent);
}
.field label { color: var(--ink-2); font-weight: 590; }

.seg { background: var(--sys-fill); }
.seg button { color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--sys-field); color: var(--ink); }
html[data-theme="dark"] .seg button[aria-pressed="true"] { background: rgba(255,255,255,.16); }

.spot-row[aria-selected="true"] { background: var(--sys-blue); color: #fff; }
.spot-row[aria-selected="true"] .spot-row-kind { color: rgba(255,255,255,.75); }
.proj:hover, .proj:focus-visible, .skill:hover { border-color: var(--sys-blue); }
a { color: var(--sys-blue); }
a:hover { color: var(--sys-blue-press); }

/* keep typing surfaces still on phones */
.shell-phone .sheet-body { scroll-padding-bottom: 140px; }
.shell-phone .term { font-size: 16px; }
.term-input { font-size: 16px; }

.note { padding: var(--s-4); border-radius: var(--r-md);
  background: var(--sys-fill); border: 1px solid var(--glass-line-soft); }
.note h2 { font-size: 15px; font-weight: 650; }
.note-meta { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.note p { color: var(--ink-2); font-size: 13.5px; }
.browser-url input { flex: 1; min-width: 0; background: none; border: 0;
  outline: none; font-size: 16px; color: var(--ink); }
.fb-inner.start { max-width: 560px; }
.fav-grid { display: grid; gap: var(--s-3); margin-top: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.fav { display: grid; gap: 8px; justify-items: center; padding: var(--s-3);
  border-radius: var(--r-md); border: 1px solid var(--glass-line-soft);
  background: var(--sys-fill); font-size: 12.5px; color: var(--ink); }
.fav:hover { border-color: var(--sys-blue); }
.fav img { width: 44px; height: 44px; border-radius: 10px; background: #fff;
  object-fit: contain; padding: 5px; }
.fav-mark { width: 44px; height: 44px; border-radius: 10px; display: grid;
  place-content: center; background: var(--sys-blue); color: #fff; font-weight: 700; }

/* App Store rows */
.store-list { display: grid; gap: var(--s-2); }
.store-row { display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) 0; border-bottom: 1px solid var(--glass-line-soft); }
.store-row:last-child { border-bottom: 0; }
.store-art { width: 56px; height: 56px; flex: none; border-radius: 13px;
  background: #fff; object-fit: contain; padding: 7px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.25); }
.store-art--mark { display: grid; place-content: center; background: var(--sys-blue);
  color: #fff; font-weight: 700; padding: 0; }
.store-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.store-name { font-size: 14.5px; font-weight: 650; }
.store-kind { font-size: 12px; color: var(--ink-3); }
.store-tag { font-size: 12.5px; color: var(--ink-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.btn--get { border-radius: var(--r-pill); padding: 6px 18px; font-size: 12.5px;
  font-weight: 700; letter-spacing: .04em; flex: none; }

/* Liquid glass controls: translucent body, refracted top edge, specular sweep */
.btn, .lock-enter, .widget-btn, .browser-btn, .fav, .seg, .switch {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.btn::before, .lock-enter::before, .widget-btn::before, .fav::before {
  content: "";
  position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.04) 46%,
      rgba(255,255,255,0) 62%),
    radial-gradient(120% 100% at 50% -30%, rgba(255,255,255,.30), transparent 60%);
  pointer-events: none;
}
.btn::after, .lock-enter::after, .widget-btn::after, .fav::after {
  content: "";
  position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5),
              inset 0 -1px 0 rgba(0,0,0,.18),
              inset 0 0 0 .5px rgba(255,255,255,.18);
  pointer-events: none;
}
.btn, .widget-btn, .fav { transition: transform .22s var(--spring),
  background .22s var(--ease-out), box-shadow .22s var(--ease-out); }
.btn:hover, .widget-btn:hover, .fav:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.28); transform: translateY(-1px);
}
.btn:active, .widget-btn:active, .fav:active { transform: scale(.97) translateY(0); }
.btn--primary::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.06) 48%,
      rgba(0,0,0,.06) 100%);
}
.btn--primary { box-shadow: 0 2px 10px color-mix(in srgb, var(--sys-blue) 45%, transparent); }
.btn--primary:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--sys-blue) 55%, transparent); }

/* ---------------------------------------------------------------- v6 */

/* Logos sit on nothing. No white plate; depth comes from a cast shadow. */
.org-mark--img, .cert-seal--img, .proj-mark--img, .store-art, .fav img {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45))
          drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
html[data-theme="light"] .org-mark--img,
html[data-theme="light"] .cert-seal--img,
html[data-theme="light"] .proj-mark--img,
html[data-theme="light"] .store-art,
html[data-theme="light"] .fav img {
  filter: drop-shadow(0 6px 14px rgba(20, 30, 60, .22));
}
.org-mark--img img, .cert-seal--img img, .proj-mark--img img { padding: 0; }
.org-mark { width: 48px; height: 48px; }
.proj-mark { width: 54px; height: 54px; border-radius: 13px; }
.cert-seal { width: 46px; height: 46px; }
.store-art { width: 66px; height: 66px; padding: 0; object-fit: contain; }
.fav img { width: 56px; height: 56px; padding: 0; }

/* Brand marks in Capability: large, 3D, no plate */
.skill-mark { width: 44px; height: 44px; background: none !important; }
.skill-mark .brand {
  width: 30px; height: 30px;
  filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .5));
}
html[data-theme="light"] .skill-mark .brand {
  filter: drop-shadow(0 4px 9px rgba(20, 30, 60, .28));
}
.skill { padding: 12px 14px; border-radius: var(--r-lg); }

/* Portrait in About */
.hero-portrait {
  width: 128px; height: 128px; border-radius: 28px; object-fit: cover;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255,255,255,.18);
}

/* Certificate documents */
.cert { border-radius: var(--r-lg); width: 100%; text-align: left; }
.cert-open { margin-left: auto; flex: none; font-size: 12px; font-weight: 650;
  color: var(--sys-blue); }
.doc-stage { display: grid; gap: var(--s-3); }
.doc-title { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.doc-img { width: 100%; height: auto; border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,.5); background: #fff; }

/* Rounded, glassy form controls */
.input, textarea.input { border-radius: 14px; }
.btn, .btn--get { border-radius: var(--r-pill); }
.seg { border-radius: 14px; }
.seg button { border-radius: 11px; }

/* Mobile: nothing clipped, nothing needing a horizontal scroll */
@media (max-width: 699px) {
  .app { padding: 18px 16px 28px; }
  .app-title { font-size: 26px; line-height: 1.15; }
  .app-sub, .prose p, .proj-tag { font-size: 15px; }
  .spec-row { flex-direction: column; gap: 2px; padding: 12px 0; }
  .spec-key { width: auto; font-size: 12px; }
  .spec-val { font-size: 15px; }
  .grid-2, .grid-3, .skill-grid, .metrics { grid-template-columns: 1fr; }
  .store-row { flex-wrap: wrap; }
  .store-tag { white-space: normal; }
  .btn { min-height: 44px; }
  .cert, .skill { min-height: 56px; }
}

/* Dark brand marks (NumPy, pandas, Vercel, Notion) need a lift on a dark ground */
html[data-theme="dark"] .skill-mark::before {
  content: "";
  position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.30), transparent 68%);
  z-index: 0;
}
.skill-mark { position: relative; }
.skill-mark .brand { position: relative; z-index: 1; }
html[data-theme="dark"] .skill-mark .brand {
  filter: drop-shadow(0 0 6px rgba(255,255,255,.28))
          drop-shadow(0 4px 9px rgba(0,0,0,.55));
}

/* ---------------------------------------------------------------- v7 */

/* Device mockups on project pages */
.shots { display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: end; }
.shot { width: 100%; height: auto; background: none; border-radius: 0;
  filter: drop-shadow(0 22px 44px rgba(0,0,0,.42)); }
html[data-theme="light"] .shot { filter: drop-shadow(0 18px 40px rgba(20,30,60,.22)); }

/* Full-screen document viewer with a round close control */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 4vh 3vw;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  animation: lb-in .26s var(--ease-out) both;
}
.lightbox.is-closing { animation: lb-out .2s var(--ease-out) both; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-out { to { opacity: 0; } }
.lb-figure { margin: 0; display: grid; gap: 14px; justify-items: center;
  max-width: 100%; max-height: 100%; animation: lb-pop .34s var(--spring) both; }
@keyframes lb-pop { from { transform: scale(.94); } to { transform: none; } }
.lb-figure img {
  max-width: 100%; max-height: 82vh; width: auto; height: auto;
  border-radius: 14px; background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.7);
  image-rendering: -webkit-optimize-contrast;
}
.lb-figure figcaption { color: rgba(255,255,255,.86); font-size: 13.5px;
  text-align: center; max-width: 60ch; }
.lb-close {
  position: fixed; top: calc(var(--safe-t) + 16px); right: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-content: center;
  background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: transform .2s var(--spring), background .2s;
}
.lb-close:hover { background: rgba(255,255,255,.3); transform: scale(1.07); }
.lb-close:active { transform: scale(.94); }

/* Safari favourites: legible on any theme, logos on a light chip */
.fav-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.fav { background: var(--glass-strong); border-color: var(--glass-line); }
.fav img { background: #fff !important; border-radius: 13px; padding: 8px !important;
  filter: none !important; box-shadow: 0 4px 12px rgba(0,0,0,.28) !important; }
.fb-inner.start h3 { color: var(--ink); }

/* Settings: wallpaper picker */
.wall-grid { display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.wall { display: grid; gap: 8px; padding: 8px; border-radius: var(--r-lg);
  border: 1px solid var(--glass-line-soft); background: var(--sys-fill);
  font-size: 12.5px; color: var(--ink); }
.wall img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; }
.wall.is-on { border-color: var(--sys-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sys-blue) 30%, transparent); }

/* Reduce transparency */
html[data-solid="on"] .window, html[data-solid="on"] .sheet,
html[data-solid="on"] #dock, html[data-solid="on"] #menubar,
html[data-solid="on"] .spot-panel, html[data-solid="on"] #homedock,
html[data-solid="on"] .widget {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  background: var(--glass-solid) !important;
}
/* Larger text */
html[data-text="large"] { font-size: 17px; }
html[data-text="large"] body { font-size: 16px; }
html[data-text="large"] .app-sub, html[data-text="large"] .prose p,
html[data-text="large"] .proj-tag, html[data-text="large"] .spec-val { font-size: 16.5px; }

/* ---------------------------------------------------------------- v8 */

/* Lock screen: name, role and button match the clock exactly */
#lock .lock-name, #lock .lock-role, #lock .lock-enter, #lock .lock-hint {
  color: #fff !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}
#lock .lock-name { font-size: 19px; font-weight: 600; }
#lock .lock-role { font-size: 15px; opacity: .95; }
#lock .lock-enter {
  font-size: 15px; font-weight: 600; padding: 12px 26px;
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .42);
}
#lock .lock-hint { opacity: .8; }

/* Certificates fill the viewport */
.lb-figure img { max-height: 90vh; max-width: 96vw; }
.lb-figure figcaption { font-size: 15px; font-weight: 550; }
@media (max-width: 699px) {
  .lightbox { padding: 0; }
  .lb-figure img { max-height: 78vh; max-width: 100vw; border-radius: 0; }
  .lb-figure figcaption { padding: 0 18px; }
}

/* Reduce transparency must never swallow text */
html[data-solid="on"] {
  --glass: var(--glass-solid);
  --glass-strong: var(--glass-solid);
  --glass-line: rgba(120, 130, 150, .34);
  --glass-line-soft: rgba(120, 130, 150, .2);
}
html[data-solid="on"] #menubar {
  background: rgba(20, 26, 38, .96) !important;
  color: #fff !important;
}
html[data-solid="on"] #menubar .menu-item,
html[data-solid="on"] #menubar .menu-clock { color: #fff !important; }
html[data-solid="on"] #lock { background: rgba(8, 12, 20, .55); }
html[data-solid="on"] .widget {
  background: rgba(20, 26, 38, .9) !important;
  color: #fff !important;
}
html[data-solid="on"] .home-app-label { color: #fff !important; }
html[data-solid="on"] .window, html[data-solid="on"] .sheet { color: var(--ink); }

/* Wallpaper picker with upload */
.wall--add { display: grid; gap: 8px; }
.wall-drop {
  display: grid; place-items: center; gap: 6px;
  aspect-ratio: 16/10; border-radius: 12px;
  border: 1.5px dashed var(--glass-line);
  color: var(--ink-2); font-size: 12px; text-align: center;
}
.wall--add:hover .wall-drop { border-color: var(--sys-blue); color: var(--sys-blue); }

/* ---------------------------------------------------------------- v9 */

/* Certificates scale UP to fill the viewer, never sit small in the middle */
.lb-figure { width: 100%; }
/* Always fill the viewer. A low-resolution source will soften; that is the
   trade the owner asked for over a small, sharp image. */
.lb-figure img {
  width: min(96vw, 1600px);
  height: auto;
  max-height: 92vh;
  object-fit: contain;
  background: none;
  border-radius: 10px;
}
@media (max-width: 699px) {
  .lb-figure img { width: 100vw; max-height: 80vh; border-radius: 0; }
}

/* Headline figures in About */
.glance { padding: var(--s-2) 0 var(--s-3); }
.glance .metric-value { font-size: clamp(24px, 4vw, 32px); color: var(--sys-blue); }

/* Career: give the longer bullet lists room to breathe */
.tl-detail li { line-height: 1.55; }
.tl-item { padding-bottom: var(--s-6); }
