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

/* ============================================================
   WALL — cream background with subtle plaster texture
   ============================================================ */

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

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.4), transparent 60%),
    radial-gradient(ellipse at 80% 85%, rgba(0,0,0,0.04), 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.04'/%3E%3C/svg%3E");
}

/* ============================================================
   WALL NAME — above the board
   ============================================================ */
.wall-name {
  position: relative;
  z-index: 2;
  text-align: center;
}

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

.wall-subtitle {
  font-family: var(--mono);
  font-size: clamp(0.5rem, 1vw, 0.68rem);
  color: var(--ink-faded);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ============================================================
   CORKBOARD FRAME — thick wooden frame with shadow on wall
   ============================================================ */
.corkboard-frame {
  position: relative;
  z-index: 1;
  width: 88vw;
  max-width: 1200px;
  height: 68vh;
  padding: 14px;
  background:
    linear-gradient(160deg,
      #a07830 0%, #8B6914 15%, #7a5a1e 35%,
      #604510 55%, #7a5a1e 75%, #8B6914 90%, #a07830 100%);
  border-radius: 3px;
  box-shadow:
    0 12px 50px rgba(0,0,0,0.35),
    0 3px 10px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    inset 1px 0 0 rgba(255,255,255,0.08),
    inset -1px 0 0 rgba(0,0,0,0.2);
}

/* Wood grain texture on frame */
.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 INTERIOR — cork texture with grid
   ============================================================ */
.corkboard {
  width: 100%;
  height: 100%;
  background: var(--cork);
  border-radius: 1px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 14px;
  padding: 18px;
  align-items: center;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

/* Cork noise texture */
.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.06), transparent 50%),
    radial-gradient(ellipse at 70% 75%, rgba(0,0,0,0.06), 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.12'/%3E%3C/svg%3E");
  z-index: 0;
}

/* Cork grain */
.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.018) 22px, rgba(0,0,0,0.018) 23px);
  z-index: 0;
}

.board-cell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* ============================================================
   NOTES / CARDS — compact for board
   ============================================================ */
.note {
  position: relative;
  z-index: 1;
  background: var(--paper);
  padding: 14px 14px 12px;
  border-radius: 1px;
  box-shadow: var(--shadow-card);
  transition: transform var(--ease), box-shadow var(--ease);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.note:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.note-white { background: #fff; }
.note-aged {
  background: var(--paper-aged);
  background-image:
    repeating-linear-gradient(
      transparent, transparent 27px,
      rgba(0,0,0,0.04) 27px, rgba(0,0,0,0.04) 28px
    );
}

.note-tag {
  font-family: var(--mono);
  font-size: 0.52rem;
  color: var(--ink-faded);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  margin-bottom: 4px;
  opacity: 0.72;
}

.note h3 {
  font-family: var(--hand);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.15;
}

.note p {
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--ink-mid);
}

/* ============================================================
   PINS — decorative push pins
   ============================================================ */
.pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 3px 5px rgba(0,0,0,0.3), inset 0 -2px 3px rgba(0,0,0,0.2), inset 0 1px 2px rgba(255,255,255,0.4);
}
.pin-red { background: radial-gradient(circle at 35% 35%, #e74c3c, #922b21); left: 45%; }
.pin-blue { background: radial-gradient(circle at 35% 35%, #3498db, #1a5276); left: 55%; }
.pin-yellow { background: radial-gradient(circle at 35% 35%, #f1c40f, #b7950b); }
.pin-green { background: radial-gradient(circle at 35% 35%, #2ecc71, #1a8a4a); left: 40%; }

/* ============================================================
   TAPE — decorative adhesive tape
   ============================================================ */
.tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 60px; height: 17px;
  background: var(--tape);
  border-left: 1px solid rgba(200,160,0,0.2);
  border-right: 1px solid rgba(200,160,0,0.2);
  z-index: 10;
}

/* ============================================================
   FOLDERS — translucent file folders with pages inside
   ============================================================ */
.folder {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 3px 3px 2px 2px;
  backdrop-filter: blur(1px);
  padding: 28px 14px 14px;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
  box-shadow: 2px 4px 12px rgba(0,0,0,0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.folder:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-3px) rotate(0.5deg);
  box-shadow: 4px 8px 20px rgba(0,0,0,0.22);
}

/* Folder tab */
.folder-tab {
  position: absolute;
  top: -1px; left: 12px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.5);
  border-bottom: none;
  padding: 2px 16px;
  border-radius: 4px 4px 0 0;
  font-family: var(--hand);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mid);
  transform: translateY(-100%);
}

/* Pages peeking out */
.folder-pages {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  height: 60%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.folder-page {
  flex: 1;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transform-origin: top left;
}
.folder-page:nth-child(1) { transform: rotate(-1.5deg); margin-left: 4px; }
.folder-page:nth-child(2) { transform: rotate(0.8deg); margin-left: 8px; }
.folder-page:nth-child(3) { transform: rotate(-0.5deg); margin-left: 2px; }

.folder-label {
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  z-index: 2;
}

.folder-hint {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--ink-faded);
  opacity: 0;
  transition: opacity 0.2s;
  position: relative;
  z-index: 2;
  margin-top: 2px;
}
.folder:hover .folder-hint { opacity: 1; }

/* ============================================================
   CV HUNG — miniature pinned CV sheet
   ============================================================ */
.cv-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-hung {
  position: relative;
  width: 80%;
  max-width: 180px;
  margin-top: 12px;
}

.cv-string {
  position: absolute;
  top: -22px;
  width: 1.5px;
  height: 28px;
  background: linear-gradient(to bottom, #8b7355, #6b5a3e);
  z-index: 2;
}
.cv-string-l { left: 25%; transform: rotate(-6deg); }
.cv-string-r { right: 25%; transform: rotate(6deg); }

.cv-pin {
  position: absolute;
  top: -28px;
  width: 13px; height: 13px;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 -1px 2px rgba(0,0,0,0.2), inset 0 1px 2px rgba(255,255,255,0.3);
}
.cv-pin-l { left: calc(25% - 6px); background: radial-gradient(circle at 35% 35%, #e74c3c, #922b21); }
.cv-pin-r { right: calc(25% - 6px); background: radial-gradient(circle at 35% 35%, #3498db, #1a5276); }

.cv-sheet {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
  transform: rotate(-0.8deg);
}
.cv-sheet:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

.cv-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}
.cv-overlay-text {
  font-family: var(--hand);
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 6px 16px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s;
}
.cv-sheet:hover .cv-overlay { background: rgba(0,0,0,0.2); }
.cv-sheet:hover .cv-overlay-text { opacity: 1; transform: translateY(0); }

/* ============================================================
   CONTACT FORM — compact on board card
   ============================================================ */
.contact-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field { position: relative; }

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

.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.65rem;
  padding: 2px 0;
  color: var(--ink);
  outline: none;
}
.form-input:focus { border-bottom-color: var(--pin-blue); }

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

.form-send {
  font-family: var(--hand);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 14px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 3px;
  background: var(--paper-yellow);
  cursor: pointer;
  transition: background var(--ease);
  align-self: flex-start;
  margin-top: 2px;
}
.form-send:hover { background: #fef0a0; }
.form-send:disabled { opacity: 0.5; cursor: default; }

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

.contact-links {
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-link {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--pin-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--ease);
}
.contact-link:hover { color: var(--ink); }
.contact-link-icon { font-size: 0.65rem; }

/* ============================================================
   TIC-TAC-TOE
   ============================================================ */
.ttt {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: center;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: min(140px, 100%);
  aspect-ratio: 1;
  border: none;
}

.ttt-cell {
  background: transparent;
  border: 1.5px solid var(--ink-faded);
  font-family: var(--hand);
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ttt-cell:hover:not(:disabled) { background: rgba(0,0,0,0.04); }
.ttt-cell:disabled { cursor: default; }

/* Hide outer borders for clean look */
.ttt-cell:nth-child(-n+3) { border-top: none; }
.ttt-cell:nth-child(3n) { border-right: none; }
.ttt-cell:nth-child(3n+1) { border-left: none; }
.ttt-cell:nth-child(n+7) { border-bottom: none; }

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

.ttt-status {
  font-family: var(--hand);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
}

.ttt-score {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--ink-faded);
  margin-top: 2px;
}

.ttt-reset {
  font-family: var(--hand);
  font-size: 0.7rem;
  padding: 2px 10px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  margin-top: 4px;
  transition: background var(--ease);
}
.ttt-reset:hover { background: rgba(0,0,0,0.05); }

/* ============================================================
   MODALS — fullscreen overlays
   ============================================================ */
.cv-modal,
.card-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cv-modal.open,
.card-modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92);
  transition: transform 0.3s;
}
.cv-modal.open .modal-content,
.card-modal.open .modal-content {
  transform: scale(1);
}

.modal-content-pdf {
  height: 90vh;
  max-width: 900px;
}

.modal-x {
  position: absolute;
  top: -14px; right: -14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #333;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.modal-x:hover { background: var(--pin-red); color: #fff; }

.modal-iframe {
  width: 100%;
  flex: 1;
  border: none;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
  background: #fff;
}

.modal-download {
  margin-top: 10px;
  font-family: var(--hand);
  font-size: 1rem;
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 6px 20px;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s;
}
.modal-download:hover { background: rgba(255,255,255,0.3); }

/* Modal with cork board interior (for Research/Projects) */
.modal-board {
  background: var(--cork);
  border-radius: 4px;
  padding: 28px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.12);
  position: relative;
}
.modal-board::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 4px;
  background:
    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");
}

.modal-title {
  font-family: var(--hand);
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  margin-bottom: 20px;
}

.modal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* Cards inside modals - normal sized */
.modal-cards .note {
  height: auto;
  padding: 24px 18px 18px;
}
.modal-cards .note h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}
.modal-cards .note p {
  font-size: 0.75rem;
}

.modal-subtitle {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  margin-top: -14px;
  margin-bottom: 18px;
}

.report-figures-title {
  font-family: var(--hand);
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  margin-top: 24px;
  margin-bottom: 12px;
}

.report-figures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.report-figure {
  background: #fff;
  border-radius: 3px;
  padding: 8px;
  box-shadow: var(--shadow-card);
  transition: transform var(--ease), box-shadow var(--ease);
}
.report-figure:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.report-figure img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  display: block;
}

.report-figure figcaption {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--ink-faded);
  margin-top: 6px;
  line-height: 1.4;
}

.lined {
  background-image:
    repeating-linear-gradient(
      transparent, transparent 27px,
      rgba(0,0,0,0.04) 27px, rgba(0,0,0,0.04) 28px
    );
}

/* ============================================================
   HIDE MOBILE-CREATED ELEMENTS on desktop (defensive)
   ============================================================ */
.mobile-menu,
.mobile-card-view {
  display: none !important;
}

/* ============================================================
   REPORT DOWNLOAD BUTTON
   ============================================================ */
.report-download {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 24px;
  border: 1px dashed rgba(255,255,255,0.4);
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
  transition: background var(--ease);
}
.report-download:hover {
  background: rgba(255,255,255,0.3);
}

/* ============================================================
   FOCUS STYLES
   ============================================================ */
.cv-sheet:focus-visible,
.folder:focus-visible { outline: 2px solid var(--pin-blue); outline-offset: 3px; }
.form-send:focus-visible { outline: 2px solid var(--pin-blue); outline-offset: 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .corkboard {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .corkboard-frame { padding: 10px; height: 72vh; }
  .wall-name h1 { font-size: 1.8rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body { background: white; height: auto; overflow: visible; }
  .corkboard-frame { box-shadow: none; border: 1px solid #ccc; height: auto; }
  .corkboard { display: block; background: white; }
  .pin, .tape, .folder-pages { display: none; }
  .note { box-shadow: 1px 1px 3px rgba(0,0,0,0.1); }
}
