/* ══════════════════════════════════════════════════════════
   Portfolio — Flex Layout
   Uses CSS variables defined in /theme.css
   Unified rhythm · Preset overrides are visual-only
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body-font, 'DM Sans', system-ui, -apple-system, sans-serif);
  font-size: 15px;
  background: var(--dt-bg, #1a1525);
  color: var(--text, #e8d5a3);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  padding: 96px 64px 160px;
}

/* ── Logo ───────────────────────────────────────────────── */

.pf-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 32px;
  border-radius: 10px;
}

/* ── Name + Role ────────────────────────────────────────── */

.pf-head {
  margin-bottom: 48px;
}

.pf-name {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 600;
  color: var(--text, #e8d5a3);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pf-role {
  font-size: 16px;
  color: var(--text-muted, rgba(232,213,163,0.5));
  margin-top: 12px;
}

/* ── Tabs ───────────────────────────────────────────────── */

.pf-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--div-top, rgba(255,255,255,0.08));
}

.pf-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 0;
  margin-right: 28px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted, rgba(232,213,163,0.45));
  cursor: pointer;
  margin-bottom: -1px;
  letter-spacing: 0;
  transition: color 0.15s, border-color 0.15s;
}

.pf-tab:hover {
  color: var(--text, #e8d5a3);
}

.pf-tab.active {
  color: var(--text, #e8d5a3);
  border-bottom-color: var(--nav-active, #9b82dc);
}
.pf-tab:focus-visible {
  outline: 2px solid var(--nav-active);
  outline-offset: 2px;
}

/* ── Panels ─────────────────────────────────────────────── */

.pf-panel { display: block; }
.pf-panel.hidden { display: none; }

/* ── Cards ──────────────────────────────────────────────── */

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  width: calc(50% - 12px);
  border-radius: var(--win-radius, 12px);
  overflow: hidden;
  border: 1px solid var(--div-top, rgba(255,255,255,0.07));
  background: var(--win-bg, rgba(255,255,255,0.04));
  transition: border-color 0.2s, transform 0.25s;
}

.card:hover {
  border-color: var(--nav-active, rgba(155,130,220,0.4));
  transform: translateY(-3px);
}

.card-preview {
  aspect-ratio: 16 / 9;
  background: #0c0202;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(192,57,43,0.18) 0%, transparent 70%);
}

/* Triple-class chain (0,3,0) beats html[data-style] .card-preview (0,2,1)
   so the awards-card brand colour wins regardless of the active theme.    */
.card .card-preview.card-preview--awards { background: #0a0a1e; }

.card-emoji {
  font-size: 56px;
  position: relative;
  z-index: 1;
}

.card-sigil {
  width: 44%;
  height: 44%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.2s;
}

.card:hover .card-sigil {
  opacity: 1;
  transform: scale(1.04);
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s, transform 0.2s;
}

.card:hover .card-cover {
  transform: scale(1.03);
}

.card-bottom {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #e8d5a3);
  line-height: 1.3;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted, rgba(232,213,163,0.5));
  line-height: 1.4;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.card:hover .card-desc {
  max-height: 60px;
  opacity: 1;
  margin-top: 4px;
}

/* ── About ──────────────────────────────────────────────── */

.about {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.about-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--win-radius, 10px);
  flex-shrink: 0;
  border: 1px solid var(--div-top, rgba(255,255,255,0.08));
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.about-hi {
  font-size: 22px;
  font-weight: 600;
  color: var(--text, #e8d5a3);
}

.about-loc {
  font-size: 13px;
  color: var(--text-muted, rgba(232,213,163,0.5));
}

.about-bio {
  font-size: 15px;
  color: var(--text-muted, rgba(232,213,163,0.7));
  margin-top: 6px;
  line-height: 1.7;
}

/* ── Experience ─────────────────────────────────────────── */

.exp {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exp-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(232,213,163,0.35));
  margin-bottom: 6px;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 600px;
}

.exp-sub {
  padding-left: 12px;
  margin-top: -2px;
}

.exp-date {
  font-size: 12px;
  color: var(--text-muted, rgba(232,213,163,0.3));
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.exp-co {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e8d5a3);
  white-space: nowrap;
}

.exp-role {
  font-size: 13px;
  color: var(--text-muted, rgba(232,213,163,0.55));
}

/* ── Contact ────────────────────────────────────────────── */

.contact {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact a {
  font-size: 14px;
  color: var(--nav-active, #9b82dc);
  text-decoration: none;
  transition: color 0.15s;
}

.contact a:hover {
  color: var(--text, #e8d5a3);
}

.contact span {
  font-size: 14px;
  color: var(--text-muted, rgba(232,213,163,0.5));
}

/* ── Floating lang button ───────────────────────────────── */

#lang-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  background: var(--header-btn-bg, rgba(6,0,0,0.7));
  border: 1px solid var(--header-btn-border, rgba(255,255,255,0.12));
  border-radius: var(--win-radius, 6px);
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted, rgba(232,213,163,0.7));
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s, color 0.15s;
}

#lang-btn:hover {
  border-color: var(--nav-active, rgba(155,130,220,0.5));
  color: var(--text, #e8d5a3);
}

/* ── Floating theme switcher (position only, base styles in shared.css) */

#theme-switcher {
  position: fixed;
  bottom: 20px;
  left: 16px;
  z-index: 200;
  background: var(--header-btn-bg, rgba(6,0,0,0.7));
  border: 1px solid var(--header-btn-border, rgba(255,255,255,0.1));
  border-radius: var(--win-radius, 8px);
  padding: 6px 8px;
  backdrop-filter: blur(10px);
}

/* ═══════════════════════════════════════════════════════════
   MODERN — visual overrides only
   ═══════════════════════════════════════════════════════════ */

html[data-style="modern"] .pf-name {
  font-weight: 700;
  letter-spacing: -0.03em;
}

html[data-style="modern"] .pf-role {
  font-weight: 400;
  opacity: 0.55;
}

html[data-style="modern"] .pf-tabs {
  border-bottom: none;
}

html[data-style="modern"] .pf-tab {
  opacity: 0.4;
  transition: opacity 0.15s, border-color 0.15s;
}

html[data-style="modern"] .pf-tab:hover {
  opacity: 0.7;
  color: inherit;
}

html[data-style="modern"] .pf-tab.active {
  opacity: 1;
  border-bottom-color: currentColor;
}

html[data-style="modern"] .card {
  border: none;
  border-radius: 14px;
  background: transparent;
}

html[data-style="modern"] .card:hover {
  border-color: transparent;
}

html[data-style="modern"] .card-preview {
  border-radius: 14px;
  background: var(--win-bg, #060d28);
}

html[data-style="modern"] .card-bottom {
  padding: 16px 4px 8px;
  background: transparent;
}

html[data-style="modern"] .card-label {
  font-size: 16px;
}

html[data-style="modern"] .about-photo {
  border-radius: 50%;
  border: none;
}

html[data-style="modern"] .about-hi {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

html[data-style="modern"] .about-bio {
  opacity: 0.6;
}

html[data-style="modern"] .about-loc {
  opacity: 0.45;
}

html[data-style="modern"] .exp-title {
  letter-spacing: 0.1em;
  opacity: 0.4;
}

html[data-style="modern"] .exp-date {
  opacity: 0.35;
}

/* ═══════════════════════════════════════════════════════════
   GOT — visual overrides only
   ═══════════════════════════════════════════════════════════ */

html[data-style="got"] .pf-name {
  letter-spacing: 0.04em;
}

html[data-style="got"] .pf-role {
  font-size: 12px;
  letter-spacing: 0.12em;
}

html[data-style="got"] .pf-tab {
  letter-spacing: 0.1em;
  font-size: 11px;
}

html[data-style="got"] .card {
  border-radius: 0;
  border-color: rgba(192,57,43,0.25);
}

html[data-style="got"] .card:hover {
  border-color: var(--nav-active, #c0392b);
}

html[data-style="got"] .card-label {
  font-size: 12px;
  letter-spacing: 0.08em;
}

html[data-style="got"] .card-desc {
  font-family: 'DM Sans', system-ui, sans-serif;
}

html[data-style="got"] .about-photo {
  border-radius: 0;
  border-color: rgba(192,57,43,0.3);
}

html[data-style="got"] .about-hi {
  letter-spacing: 0.06em;
}

html[data-style="got"] .exp-title {
  letter-spacing: 0.18em;
}

html[data-style="got"] .exp-co {
  font-size: 12px;
  letter-spacing: 0.06em;
}

html[data-style="got"] #lang-btn {
  letter-spacing: 0.15em;
  border-color: rgba(192,57,43,0.35);
  border-radius: 3px;
  color: #c9a84c;
}

/* ═══════════════════════════════════════════════════════════
   WIN95 — visual overrides only (layout stays unified)
   ═══════════════════════════════════════════════════════════ */

/* Window frame */
html[data-style="win95"] main {
  background: var(--win-bg, #c0c0c0);
  border: 2px solid;
  border-top-color: var(--btn-lt, #dfdfdf);
  border-left-color: var(--btn-lt, #dfdfdf);
  border-right-color: var(--btn-dk, #404040);
  border-bottom-color: var(--btn-dk, #404040);
  box-shadow: var(--win-shadow, inset 1px 1px 0 #fff, inset -1px -1px 0 #868a8e, 1px 1px 0 #000);
  padding: 48px 32px 64px;
  position: relative;
}

/* Titlebar */
html[data-style="win95"] main::before {
  content: 'Portfolio';
  display: block;
  position: absolute;
  top: 2px; left: 2px; right: 2px;
  height: 22px;
  background: var(--titlebar, linear-gradient(to right, #000080, #1084d0));
  color: var(--titlebar-fg, #fff);
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  padding: 0 4px;
  letter-spacing: 0;
}

html[data-style="win95"] .pf-name {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
}

/* Tabs as Win95 tab control */
html[data-style="win95"] .pf-tabs {
  border-bottom: 2px solid var(--btn-dk, #404040);
  gap: 0;
}

html[data-style="win95"] .pf-tab {
  background: var(--win-bg, #c0c0c0);
  border: 2px solid;
  border-top-color: var(--btn-lt, #dfdfdf);
  border-left-color: var(--btn-lt, #dfdfdf);
  border-right-color: var(--btn-dk, #404040);
  border-bottom-color: var(--win-bg, #c0c0c0);
  padding: 4px 14px;
  margin-bottom: -2px;
  margin-right: 0;
  font-size: 11px;
  position: relative;
  color: var(--text, #000);
}

html[data-style="win95"] .pf-tab:not(.active) {
  border-bottom-color: var(--btn-dk, #404040);
  top: 2px;
  color: var(--text-muted, #444);
}

html[data-style="win95"] .pf-tab.active {
  border-bottom-color: var(--win-bg, #c0c0c0);
  color: var(--text, #000);
  z-index: 1;
}

/* Card as sunken panel */
html[data-style="win95"] .card {
  border-radius: 0;
  border: 2px solid;
  border-top-color: var(--btn-dk, #404040);
  border-left-color: var(--btn-dk, #404040);
  border-right-color: var(--btn-lt, #dfdfdf);
  border-bottom-color: var(--btn-lt, #dfdfdf);
  box-shadow: inset 1px 1px 0 var(--btn-dk-inner, #868a8e), inset -1px -1px 0 var(--btn-lt-inner, #fff);
  background: var(--win-bg, #c0c0c0);
}

html[data-style="win95"] .card:hover {
  transform: none;
  border-top-color: var(--btn-dk, #404040);
  border-left-color: var(--btn-dk, #404040);
  border-right-color: var(--btn-lt, #dfdfdf);
  border-bottom-color: var(--btn-lt, #dfdfdf);
}

html[data-style="win95"] .card-preview {
  background: #000;
  border-bottom: 2px solid var(--btn-dk-inner, #868a8e);
}

html[data-style="win95"] .card-bottom {
  background: var(--win-bg, #c0c0c0);
}

/* Photo as sunken well */
html[data-style="win95"] .about-photo {
  border-radius: 0;
  border: 2px solid;
  border-top-color: var(--btn-dk, #404040);
  border-left-color: var(--btn-dk, #404040);
  border-right-color: var(--btn-lt, #dfdfdf);
  border-bottom-color: var(--btn-lt, #dfdfdf);
  box-shadow: inset 1px 1px 0 var(--btn-dk-inner, #868a8e);
}

/* Experience section — sunken group box */
html[data-style="win95"] .exp {
  border: 2px solid;
  border-top-color: var(--btn-dk-inner, #868a8e);
  border-left-color: var(--btn-dk-inner, #868a8e);
  border-right-color: var(--btn-lt, #dfdfdf);
  border-bottom-color: var(--btn-lt, #dfdfdf);
  padding: 12px 10px 10px;
  position: relative;
}

html[data-style="win95"] .exp-title {
  position: absolute;
  top: -7px;
  left: 8px;
  background: var(--win-bg, #c0c0c0);
  padding: 0 4px;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

/* Buttons — proper 3D bevel with outer shadow */
html[data-style="win95"] #lang-btn {
  border-radius: 0;
  background: var(--btn-face, #c0c0c0);
  border: none;
  box-shadow:
    inset -1px -1px 0 var(--btn-dk, #404040),
    inset 1px 1px 0 var(--btn-lt, #dfdfdf),
    inset -2px -2px 0 var(--btn-dk-inner, #868a8e),
    inset 2px 2px 0 var(--btn-lt-inner, #fff),
    1px 1px 0 #000;
  backdrop-filter: none;
  padding: 4px 10px;
  min-width: 28px;
  color: var(--text, #000);
}

html[data-style="win95"] #lang-btn:active {
  box-shadow:
    inset 1px 1px 0 var(--btn-dk, #404040),
    inset -1px -1px 0 var(--btn-lt, #dfdfdf),
    inset 2px 2px 0 var(--btn-dk-inner, #868a8e);
  padding: 5px 9px 3px 11px;
}

html[data-style="win95"] .contact a {
  color: var(--nav-active, #000080);
  text-decoration: underline;
}

/* ── Responsive (see breakpoint convention in shared.css) ── */

@media (max-width: 600px) {
  main { padding-left: 20px; padding-right: 20px; }
  .card { width: 100%; }
}

/* Small-phone tier — landing-only refinements */
@media (max-width: 480px) {
  main { padding: 48px 16px 100px; }
  .about { flex-direction: column; }
  .about-photo { width: 80px; height: 80px; }
  #theme-switcher { left: 8px; bottom: 12px; padding: 5px 6px; }
  #lang-btn { top: 12px; right: 12px; }
}
