/* Reset-ish */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #d4c5b0 0%, #c9b8a3 25%, #b8a690 50%, #c9b8a3 75%, #d4c5b0 100%);
  background-attachment: fixed;
  color: #2c2a27;
  font-family: 'Old Standard TT', Georgia, "Times New Roman", serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 10px;
}

/* Layout */
main {
  max-width: 600px;
  width: 100%;
  padding: 48px 40px;
  background: linear-gradient(to bottom, #f5ede0 0%, #ede4d6 25%, #e8ddd0 50%, #ede4d6 75%, #f5ede0 100%);
  border-radius: 4px;
  box-shadow: 
    0 50px 150px rgba(0, 0, 0, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.2),
    0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 2px 8px rgba(139, 100, 70, 0.15) inset;
  position: relative;
  margin: 0;
  border: 1px solid rgba(139, 100, 70, 0.1);
}

main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(139, 100, 70, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 100, 70, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(139, 100, 70, 0.05) 0%, transparent 40%),
    linear-gradient(90deg, transparent 0%, rgba(139, 100, 70, 0.02) 50%, transparent 100%);
  pointer-events: none;
  border-radius: 4px;
}

/* Additional micro-fiber noise for a more organic paper texture */
main::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(139, 100, 70, 0.03) 0.6px, transparent 0.7px),
    radial-gradient(rgba(0,0,0,0.015) 0.4px, transparent 0.5px);
  background-size: 18px 18px, 12px 12px;
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: multiply;
  border-radius: 4px;
}

/* Header */
header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  padding-top: 0;
  border-bottom: 2px solid rgba(139, 100, 70, 0.2);
  position: relative;
  min-height: 50px;
  margin-top: 0;
}

h1 {
  font-size: 32px;
  font-weight: 400;
  margin: 0 0 8px 0;
  padding: 0;
  color: #1a1815;
  letter-spacing: -0.5px;
  display: block;
  line-height: 1.2;
}

.subtitle {
  margin-top: 4px;
  color: #8b8680;
  font-size: 16px;
  font-style: normal;
  letter-spacing: 0.3px;
  display: block;
  font-family: 'Caveat', cursive, Georgia, serif;
  font-weight: 500;
  transform: rotate(0.3deg);
}

/* Display name in handwritten style */
.name {
  font-family: 'Caveat', cursive, Georgia, serif;
  font-weight: 600;
  font-size: 48px;
  line-height: 1.1;
  display: inline-block;
  vertical-align: middle;
  color: #1a1815;
  letter-spacing: 0.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: rotate(-0.5deg);
}

/* Name is static — typing/caret animation removed */

@keyframes cursor-blink {
  0% { opacity: 0.95; }
  50% { opacity: 0.15; }
  100% { opacity: 0.95; }
}

@keyframes cursor-bob {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* typing/caret keyframes removed */

/* Sections Container */
.sections-container {
  margin: 0;
}

/* Apply handwritten-style font to body content */
.sections-container,
.sections-container *,
footer,
body {
  font-family: 'Kalam', 'Caveat', cursive, Georgia, serif;
}

/* Handwritten feel for section text */
.sections-container p,
.sections-container li,
.sections-container h3 {
  color: #2f2d28;
  font-family: 'Kalam', cursive, Georgia, serif;
  font-weight: 400;
}

.collapsible-section {
  margin-bottom: 0;
  border-bottom: 2px solid rgba(139, 100, 70, 0.15);
}

.collapsible-section:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #1a1815;
  transition: all 0.2s ease;
}

.section-header:hover {
  color: #5d5a54;
}

.section-title {
  font-family: 'Caveat', cursive, Georgia, serif;
  font-weight: 600;
  font-size: 18px;
}

.toggle-icon {
  font-size: 20px;
  font-weight: 300;
  color: #a39d95;
  transition: transform 0.2s ease;
}

.section-content {
  padding-bottom: 16px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.collapsible-section.open .section-content {
  display: block;
}

/* Keep existing article and text styles for content */

/* Articles */
article {
  margin-bottom: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(139, 100, 70, 0.12);
}

article:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

/* Work items in Non-Tech section */
.work-item {
  margin-bottom: 22px;
}

.work-item:last-of-type {
  margin-bottom: 16px;
}

.work-meta {
  color: #8b8680;
  font-weight: normal;
  font-size: 14px;
  font-style: italic;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #1a1815;
  line-height: 1.5;
  font-family: 'Caveat', cursive, Georgia, serif;
  transform: rotate(-0.3deg);
}

h3 span {
  color: #8b8680;
  font-weight: normal;
  font-size: 14px;
  font-style: italic;
  margin-left: 4px;
}

/* Text */
p {
  font-size: 17px;
  line-height: 1.7;
  color: #3d3b38;
  margin: 0 0 12px 0;
  font-family: 'Kalam', cursive, Georgia, serif;
  font-weight: 400;
}

.design-link {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(139, 100, 70, 0.12);
}

li {
  font-size: 17px;
  line-height: 1.75;
  color: #3d3b38;
  margin-bottom: 6px;
  font-family: 'Kalam', cursive, Georgia, serif;
  font-weight: 400;
}

ul {
  padding-left: 24px;
  margin: 0;
  list-style: none;
}

ul li::before {
  content: '·';
  margin-right: 12px;
  color: #a39d95;
}

/* Bullet points for lists in articles */
.work-details {
  padding-left: 0;
  margin: 8px 0 0 0;
  list-style: none;
}

.work-details li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 6px;
  line-height: 1.7;
  color: #3d3b38;
  font-family: 'Kalam', cursive, Georgia, serif;
}

.work-details li::before {
  content: '▸';
  position: absolute;
  left: 8px;
  top: 2px;
  color: #8b8680;
  font-size: 12px;
  font-weight: normal;
}

/* Links */
a {
  color: #5d5a54;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
  font-family: 'Kalam', cursive, Georgia, serif;
}

a:hover {
  border-bottom: 2px solid #a39d95;
  color: #2c2a27;
}

/* Article links in headings */
article h3 a {
  color: #1a1815;
  border-bottom: 1px solid transparent;
  font-weight: 600;
  transition: all 0.2s ease;
}

article h3 a:hover {
  border-bottom: 1px solid #a39d95;
  color: #0f0e0d;
}

/* Links in paragraphs */
article p a {
  color: #5d5a54;
  border-bottom: 1px solid transparent;
  font-weight: 500;
}

article p a:hover {
  border-bottom: 1px solid #a39d95;
  color: #2c2a27;
}

.work-details a {
  color: #5d5a54;
  border-bottom: 1px solid transparent;
  font-weight: 500;
}

.work-details a:hover {
  border-bottom: 1px solid #a39d95;
  color: #2c2a27;
}

/* Footer */
footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid rgba(139, 100, 70, 0.15);
  font-size: 13px;
  color: #8b7a6b;
  text-align: center;
}



/* Social icons */
.socials {
  display: flex;
  gap: 10px;
  position: absolute;
  bottom: 24px;
  right: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f2efe9;
  color: #5d5a54;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.social-link svg { display: block; }

.social-link:hover { 
  background: #efeae3; 
  color: #2c2a27; 
  transform: translateY(-1px);
}

.social-link.github { color: #3b3b3b; }
.social-link.x { color: #111111; }

/* Mobile optimizations */
@media (max-width: 768px) {
  body {
    padding: 15px 8px;
  }
  
  main {
    padding: 40px 24px;
    max-width: 100%;
  }
  
  .name {
    font-size: 40px;
    transform: rotate(-0.3deg);
  }
  
  h1 {
    font-size: 28px;
    margin-bottom: 6px;
  }
  
  .subtitle {
    font-size: 15px;
    margin-top: 2px;
    transform: rotate(0.2deg);
  }
  
  .section-title {
    font-size: 16px;
  }
  
  h3 {
    font-size: 18px;
    transform: rotate(-0.2deg);
  }
  
  p {
    font-size: 16px;
  }
  
  li {
    font-size: 16px;
  }
  
  header {
    margin-bottom: 28px;
    padding-bottom: 14px;
  }

  .section-header {
    padding: 12px 0;
    font-size: 13px;
  }
  
  h3 {
    font-size: 17px;
  }
  
  p {
    font-size: 15px;
    line-height: 1.7;
  }
  
  .socials {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 20px;
    justify-content: flex-start;
  }
  
  .social-link {
    width: 32px;
    height: 32px;
  }
  
  article {
    margin-bottom: 18px;
    padding: 10px 0;
  }

  .work-item {
    margin-bottom: 20px;
  }
  
  .case-letter {
    width: 95%;
    max-height: 85vh;
  }
  
  .case-body {
    padding: 16px 18px;
  }
  
  .case-list {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 5px;
  }
  
  main {
    padding: 30px 18px;
  }
  
  .name {
    font-size: 36px;
    transform: rotate(-0.2deg);
  }
  
  h1 {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 14px;
    transform: rotate(0.15deg);
  }
  
  .section-title {
    font-size: 15px;
  }
  
  h3 {
    font-size: 17px;
    transform: rotate(-0.15deg);
  }
  
  p {
    font-size: 15px;
  }
  
  li {
    font-size: 15px;
  }
  
  header {
    margin-bottom: 24px;
    padding-bottom: 12px;
  }

  .section-header {
    padding: 10px 0;
    font-size: 12px;
    letter-spacing: 1px;
  }
  
  h3 {
    font-size: 16px;
  }
  
  p {
    font-size: 14px;
  }
  
  .social-link {
    width: 30px;
    height: 30px;
  }
  
  .case-letter {
    width: 98%;
    padding: 0;
  }
  
  .case-header {
    padding: 14px 18px;
  }
  
  .case-body {
    padding: 14px 16px;
  }
}

/* Modal: paper-frame letter for case studies */
.case-modal {
  position: fixed;
  inset: 0;
  background: rgba(12,10,8,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 28px;
}

.case-letter {
  width: min(800px, 94%);
  max-height: 90vh;
  background: linear-gradient(180deg, #fffdfa 0%, #fbf7f1 100%);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(11,9,7,0.44), 0 8px 22px rgba(0,0,0,0.18) inset;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: visible;
  position: relative;
}

/* subtle paper texture overlay */
.case-letter::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0,0,0,0.015) 0.6px, transparent 0.7px);
  background-size: 16px 16px;
  opacity: 0.55;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
}

.case-header h2 { margin: 0; font-size: 28px; font-weight: 600; color: #231f1a; font-family: 'Caveat', cursive, Georgia, serif; }
.case-close {
  background: #f6efe6;
  border: 1px solid rgba(0,0,0,0.04);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  color: #6d655e;
  display: inline-grid;
  place-items: center;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.case-close:focus {
  outline: 3px solid rgba(163,157,149,0.14);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.case-body {
  display: flex;
  justify-content: center;
  padding: 20px 22px 14px 22px;
  align-items: flex-start;
}

.case-list-wrap { width: 72%; max-width: 720px; max-height: 70vh; overflow: auto; padding-right: 8px; margin: 0 auto; }
.case-list-wrap { width: 78%; max-width: 740px; overflow: visible; padding-right: 8px; margin: 0 auto; }

.case-intro { margin: 0 0 12px 0; color: #6b645b; font-size: 14px; }
.case-list { padding: 0; margin: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; row-gap: 8px; }
.case-list li { margin: 6px 0; position: relative; padding-left: 18px; }
.case-list li::before { content: '·'; position: absolute; left: 0; top: 0; color: #c9c0b7; font-size: 18px; line-height: 1; }
.case-link { color: #2c2a27; text-decoration: none; font-size: 16px; }
.case-link::after { content: '  >'; color: #a39d95; margin-left: 6px; }
.case-link.active { font-weight: 700; color: #111; }

.case-footer { padding: 12px 18px; border-top: 1px solid #ede9e0; text-align: right; color: #8f877f; }

@media (max-width: 900px) {
  .case-body { padding: 14px; }
}

/* Case studies list (non-tech work) — unified newspaper look */
.case-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 10px;
  margin: 12px 0 0 0;
  padding: 0;
}

.case-list li { margin: 4px 0; position: relative; padding-left: 18px; }
.case-list li::before { content: '·'; position: absolute; left: 0; top: 2px; color: #c9c0b7; font-size: 18px; }

.case-link {
  display: inline-block;
  color: #2c2a27;
  text-decoration: none;
  font-family: 'Kalam', cursive, Georgia, serif;
  font-size: 16px;
  letter-spacing: 0.2px;
  transition: color 160ms ease, transform 160ms ease, padding-left 160ms ease;
  padding: 4px 0;
  font-weight: 400;
}

.case-link::after {
  content: ' ›';
  color: #a39d95;
  margin-left: 8px;
  font-weight: 400;
  font-size: 14px;
}

.case-link:hover {
  color: #0f0e0d;
  transform: translateX(6px);
  padding-left: 6px;
  text-decoration: none;
}

@media (max-width: 900px) {
  .case-list { grid-template-columns: 1fr; }
}
