/* ============================================================
   Cork Board Portfolio — mobile.css (mobile only)
   Requires base.css loaded first
   ============================================================ */

/* ============================================================
   WALL — subtle cream background
   ============================================================ */

body {
  font-family: var(--mono);
  color: var(--ink);
  background: var(--wall);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-user-select: none;
  user-select: none;
}

/* Subtle plaster — less visible on mobile */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,0.25), transparent 60%),
    radial-gradient(ellipse at 80% 85%, rgba(0,0,0,0.02), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

/* ============================================================
   WALL NAME — compact on mobile
   ============================================================ */
.wall-name {
  position: relative;
  z-index: 2;
  text-align: center;
}

.wall-name h1 {
  font-family: var(--hand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.wall-subtitle {
  font-family: var(--mono);
  font-size: 0.45rem;
  color: var(--ink-faded);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ============================================================
   CORKBOARD FRAME — thinner on mobile
   ============================================================ */
.corkboard-frame {
  position: relative;
  z-index: 1;
  width: 92vw;
  height: 75vh;
  height: 75dvh;
  padding: 6px;
  background:
    linear-gradient(160deg,
      #a07830 0%, #8B6914 15%, #7a5a1e 35%,
      #604510 55%, #7a5a1e 75%, #8B6914 90%, #a07830 100%);
  border-radius: 3px;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

.corkboard-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(95deg,
    transparent, transparent 18px,
    rgba(0,0,0,0.04) 18px, rgba(0,0,0,0.04) 19px);
  pointer-events: none;
}

/* ============================================================
   CORKBOARD — cork texture
   ============================================================ */
.corkboard {
  width: 100%;
  height: 100%;
  background: var(--cork);
  border-radius: 1px;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.12);
  overflow: hidden;
}

/* Cork noise */
.corkboard::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 1px;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255,255,255,0.05), transparent 50%),
    radial-gradient(ellipse at 70% 75%, rgba(0,0,0,0.05), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
  z-index: 0;
}

.corkboard::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 1px;
  background: repeating-linear-gradient(87deg,
    transparent, transparent 22px,
    rgba(0,0,0,0.015) 22px, rgba(0,0,0,0.015) 23px);
  z-index: 0;
}

/* ============================================================
   MENU VIEW — mini card grid (app folder style)
   ============================================================ */
.mobile-menu {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  align-items: center;
  justify-items: center;
  transition: opacity 0.3s, transform 0.3s;
}

.mobile-menu.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* Last item (5th) centers in bottom row */
.mobile-menu .mini-card:last-child {
  grid-column: 1 / -1;
}

/* ============================================================
   MINI CARDS — app-icon style
   ============================================================ */
.mini-card {
  position: relative;
  width: 100%;
  max-width: 120px;
  aspect-ratio: 3 / 3.2;
  background: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.mini-card:active {
  transform: scale(0.94);
  box-shadow: 1px 2px 6px rgba(0,0,0,0.15);
}

.mini-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.mini-card-label {
  font-family: var(--hand);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-mid);
}

/* Mini pin on each card */
.mini-card::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 2px 3px rgba(0,0,0,0.25), inset 0 -1px 2px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.3);
}

.mini-card[data-card="cv"]::before       { background: radial-gradient(circle at 35% 35%, #e74c3c, #922b21); }
.mini-card[data-card="research"]::before  { background: radial-gradient(circle at 35% 35%, #3498db, #1a5276); }
.mini-card[data-card="ttt"]::before       { background: radial-gradient(circle at 35% 35%, #f1c40f, #b7950b); }
.mini-card[data-card="contact"]::before   { background: radial-gradient(circle at 35% 35%, #2ecc71, #1a8a4a); }
.mini-card[data-card="projects"]::before  { background: radial-gradient(circle at 35% 35%, #e74c3c, #922b21); }

/* ============================================================
   CARD VIEW — full content after tap
   ============================================================ */
.mobile-card-view {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(20px);
}

.mobile-card-view.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Slide transitions for swipe */
.mobile-card-view.slide-out-left {
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.mobile-card-view.slide-out-right {
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.mobile-card-view.slide-in-left {
  transform: translateX(-100%);
  opacity: 0;
  transition: none;
}

.mobile-card-view.slide-in-right {
  transform: translateX(100%);
  opacity: 0;
  transition: none;
}

/* Top bar */
.card-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.card-back {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.card-topbar-title {
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

/* Card content area */
.card-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* Dots indicator */
.card-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  flex-shrink: 0;
}

.card-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  transition: background 0.2s;
}

.card-dot.active {
  background: rgba(0,0,0,0.6);
}

/* Swipe hint */
.swipe-hint {
  font-family: var(--hand);
  font-size: 0.65rem;
  color: var(--ink-faded);
  text-align: center;
  padding-bottom: 4px;
  opacity: 0.6;
}

/* ============================================================
   CARD CONTENT STYLES — sized for mobile
   ============================================================ */

/* --- CV Card --- */
.mobile-cv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.mobile-cv-preview {
  width: 60%;
  max-width: 200px;
  aspect-ratio: 210 / 297;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  overflow: hidden;
  position: relative;
}

.mobile-cv-preview embed {
  width: 100%; height: 100%;
  border: none;
  pointer-events: none;
}

.mobile-cv-btn {
  font-family: var(--hand);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 24px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 6px;
  background: var(--paper-yellow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-cv-download {
  text-decoration: none;
  text-align: center;
  margin-top: 4px;
}

/* --- Contact Card --- */
.mobile-contact .contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-contact .form-label {
  font-family: var(--hand);
  font-size: 0.85rem;
  color: var(--ink-faded);
  display: block;
}

.mobile-contact .form-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 4px 0;
  color: var(--ink);
  outline: none;
}
.mobile-contact .form-input:focus { border-bottom-color: var(--pin-blue); }

.mobile-contact .form-textarea {
  resize: none;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 2px;
  padding: 6px;
  min-height: 60px;
}

.mobile-contact .form-send {
  font-family: var(--hand);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 18px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 4px;
  background: var(--paper-yellow);
  cursor: pointer;
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
}
.mobile-contact .form-send:hover { background: #fef0a0; }
.mobile-contact .form-send:disabled { opacity: 0.5; cursor: default; }

.mobile-contact .form-hint {
  font-family: var(--hand);
  font-size: 0.7rem;
  color: var(--pin-green);
  min-height: 1em;
}
.mobile-contact .form-hint-error { color: var(--pin-red); }

.mobile-contact .contact-links {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-contact .contact-link {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--pin-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mobile-contact .contact-link-icon { font-size: 0.75rem; }

/* --- TTT Card --- */
.mobile-ttt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}

.mobile-ttt .ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: min(200px, 70vw);
  aspect-ratio: 1;
}

.mobile-ttt .ttt-cell {
  background: transparent;
  border: 1.5px solid var(--ink-faded);
  font-family: var(--hand);
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.mobile-ttt .ttt-cell:disabled { cursor: default; }
.mobile-ttt .ttt-cell:nth-child(-n+3) { border-top: none; }
.mobile-ttt .ttt-cell:nth-child(3n) { border-right: none; }
.mobile-ttt .ttt-cell:nth-child(3n+1) { border-left: none; }
.mobile-ttt .ttt-cell:nth-child(n+7) { border-bottom: none; }

.mobile-ttt .ttt-x { color: var(--ink); }
.mobile-ttt .ttt-o { color: var(--pin-blue); }
.mobile-ttt .ttt-win { background: rgba(46,204,113,0.15); }

.mobile-ttt .ttt-status {
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.mobile-ttt .ttt-score {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--ink-faded);
}

.mobile-ttt .ttt-reset {
  font-family: var(--hand);
  font-size: 0.8rem;
  padding: 4px 14px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* --- Research / Projects cards --- */
.mobile-folder-content {
  text-align: center;
  padding: 30px 20px;
}

.mobile-folder-content h3 {
  font-family: var(--hand);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.mobile-folder-content p {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* --- Research report (rich content) --- */
.mobile-research {
  padding: 4px 0;
}

.mobile-research-title {
  font-family: var(--hand);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.mobile-research-sub {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--ink-faded);
  margin-bottom: 14px;
  line-height: 1.4;
}

.mobile-research-section {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.mobile-research-section:last-of-type {
  border-bottom: none;
}

.mobile-research-tag {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--pin-blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.mobile-research-section:nth-child(3) .mobile-research-tag { background: var(--pin-red); }
.mobile-research-section:nth-child(5) .mobile-research-tag { background: var(--pin-yellow); }
.mobile-research-section:nth-child(6) .mobile-research-tag { background: var(--pin-green); }
.mobile-research-section:nth-child(7) .mobile-research-tag { background: var(--pin-red); }
.mobile-research-section:nth-child(8) .mobile-research-tag { background: var(--pin-blue); }

.mobile-research-section strong {
  font-family: var(--hand);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

.mobile-research-section p {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--ink-mid);
  line-height: 1.5;
  margin: 0;
}

.mobile-research-figures {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-research-figures img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.report-download {
  display: block;
  margin-top: 16px;
  font-family: var(--hand);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 6px;
  background: var(--paper-yellow);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   HIDE DESKTOP ELEMENTS on mobile
   ============================================================ */
/* Hide the original desktop grid children — mobile JS builds its own UI */
.corkboard > .board-cell,
.corkboard > .folder,
.corkboard > .note {
  display: none;
}

/* Hide desktop modals — mobile has its own card views */
.cv-modal,
.card-modal {
  display: none;
}

/* ============================================================
   FOCUS STYLES
   ============================================================ */
.mini-card:focus-visible { outline: 2px solid var(--pin-blue); outline-offset: 3px; }
.card-back:focus-visible { outline: 2px solid var(--pin-blue); outline-offset: 2px; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body { background: white; height: auto; overflow: visible; }
  .corkboard-frame { box-shadow: none; border: 1px solid #ccc; height: auto; }
  .mobile-menu, .mobile-card-view { display: none; }
}
