* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  background: #f7d49b;
  color: #17324d;
  font-family: "Courier New", Courier, monospace;
}

.sky {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  align-items: center;
  justify-items: center;
  gap: clamp(28px, 5vh, 48px);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(96px, 12vh, 140px) clamp(24px, 8vw, 120px) clamp(96px, 12vh, 140px);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #91d9f2 0%, #b8e6e5 48%, #f7d49b 100%);
}

.sky::before,
.sky::after {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
}

.sky::before {
  opacity: 0.25;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 13px 13px;
  mask-image: linear-gradient(to bottom, black, transparent 68%);
}

.sky::after {
  z-index: -1;
  background: linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, 0.18) 45% 47%, transparent 47% 100%);
}

.sun {
  position: absolute;
  top: 7vh;
  right: 8vw;
  width: clamp(72px, 11vw, 140px);
  aspect-ratio: 1;
  background: #ffd66e;
  box-shadow: 12px 12px 0 #f6b773, 24px 24px 0 rgba(255, 214, 110, 0.25);
  image-rendering: pixelated;
}

.horizon {
  position: absolute;
  bottom: 0;
  width: 100%;
  clip-path: polygon(0 66%, 7% 61%, 12% 69%, 19% 51%, 27% 63%, 34% 45%, 43% 60%, 53% 40%, 64% 64%, 75% 48%, 84% 62%, 92% 43%, 100% 58%, 100% 100%, 0 100%);
}

.horizon-back {
  height: 26vh;
  background: #a9c892;
}

.horizon-front {
  height: 18vh;
  background: #6f9c78;
  clip-path: polygon(0 66%, 9% 52%, 16% 64%, 25% 45%, 33% 62%, 43% 51%, 52% 67%, 60% 43%, 70% 60%, 82% 48%, 90% 63%, 100% 49%, 100% 100%, 0 100%);
}

#cloud-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 150px;
  height: 24px;
  opacity: 0.38;
  image-rendering: pixelated;
  animation: cloud-move 28s linear infinite;
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  background: #fff5d6;
  box-shadow: 0 12px 0 #fff5d6, 12px -12px 0 #fff5d6, 24px -24px 0 #fff5d6, 36px -12px 0 #fff5d6, 48px 0 0 #fff5d6, 60px 12px 0 #fff5d6, 72px 12px 0 #fff5d6;
}

.cloud::before {
  top: 0;
  left: 0;
  width: 48px;
  height: 24px;
}

.cloud::after {
  top: 24px;
  left: 12px;
  width: calc(100% - 36px);
  height: 12px;
  background: #e6b982;
  box-shadow: 0 12px 0 #e6b982, 12px 0 0 #e6b982, 24px 0 0 #e6b982, 36px 0 0 #e6b982, 48px 0 0 #e6b982, 60px 0 0 #e6b982;
}

.cloud.pink::after {
  background: #f0a984;
  box-shadow: 0 12px 0 #f0a984, 12px 0 0 #f0a984, 24px 0 0 #f0a984, 36px 0 0 #f0a984, 48px 0 0 #f0a984, 60px 0 0 #f0a984;
}

.cloud-one { top: 19%; animation-delay: -4s; }
.cloud-two { width: 115px; top: 34%; animation-delay: -16s; animation-duration: 22s; }
.cloud-three { width: 175px; top: 49%; animation-delay: -9s; animation-duration: 25s; }
.cloud-four { width: 120px; top: 62%; animation-delay: -20s; animation-duration: 20s; }
.cloud-five { width: 155px; top: 73%; animation-delay: -13s; animation-duration: 24s; }

.intro {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  align-self: start;
  justify-self: center;
  text-align: center;
  animation: appear 900ms ease-out both;
}

.eyebrow {
  margin: 0 0 14px;
  color: #d85d62;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.name {
  max-width: 8ch;
  margin: 0 auto;
  font-weight: 900;
  font-size: clamp(3.2rem, 7.5vw, 7.2rem);
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 7px 7px 0 rgba(255, 245, 214, 0.7);
}

.more-about-me {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 680px;
  justify-self: center;
  animation: appear 900ms 180ms ease-out both;
}

.more-about-me > div {
  margin: 0;
  color: #17324d;
  font-weight: 900;
  font-size: clamp(2rem, 4.8vw, 4.8rem);
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 6px 6px 0 rgba(255, 245, 214, 0.7);
}

.more-about-me h3 {
  margin: 12px 0 0;
  font-size: clamp(0.9rem, 1.25vw, 1.1rem);
  line-height: 1.45;
  text-align: center;
}

.hint {
  margin: 28px 0 0;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  line-height: 1.6;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes about-appear {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes cloud-move {
  from { transform: translateX(-220px); }
  to { transform: translateX(calc(100vw + 220px)); }
}

@keyframes card-open {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes close-open {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-close {
  from {
    position: fixed;
    inset: 0;
    width: auto;
    height: 100vh;
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .sun {
    top: 12vh;
    right: 8vw;
  }

  .intro {
    top: 10vh;
  }

  .hint {
    max-width: 24ch;
  }

  .more-about-me {
    max-width: calc(100% - 24px);
  }
}

.section-menu {
  position: fixed;
  top: 18px;
  right: clamp(16px, 3vw, 40px);
  z-index: 10;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.section-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: #17324d;
  border: 2px solid #17324d;
  background: #fff5d6;
  box-shadow: 3px 3px 0 #17324d;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-button:hover,
.section-button:focus-visible {
  color: #fff5d6;
  background: #d85d62;
  outline: none;
}

.section-icon {
  font-size: 1rem;
  font-weight: 900;
}

.portfolio-sections {
  background: #f7d49b;
}

.portfolio-section {
  min-height: 100svh;
  padding: clamp(88px, 10vh, 120px) clamp(20px, 6vw, 88px) 64px;
  scroll-margin-top: 20px;
}

.article-section {
  background: #f9d7e5;
}

.certificate-section {
  background: #dfeecf;
}

.project-section {
  background: #f7d49b;
}

.section-heading {
  margin-bottom: 42px;
  color: #17324d;
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 6px 6px 0 rgba(255, 245, 214, 0.7);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

.articles-grid {
  align-items: stretch;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.article-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 #17324d;
}

.article-summary {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-tag {
  margin: 0 0 8px;
  color: #d85d62;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #17324d;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(216, 93, 98, 0.08);
  text-decoration: none;
}

.article-text-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  height: 220px;
  min-height: 220px;
  padding: 66px 24px 18px;
  text-align: left;
  overflow: hidden;
}

.writing-preview {
  background: linear-gradient(140deg, #fff0d2, #f6c7ad);
}

.ai-preview {
  background: linear-gradient(140deg, #f9d7e5, #f5bba9 55%, #ffe9c4);
}

.ideas-preview {
  background: linear-gradient(140deg, #e5e6ff, #c9d9f4);
}

.preview-label {
  display: inline-block;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 6px 10px;
  background: #17324d;
  color: #fff5d6;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.article-text-preview strong {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 22ch;
  color: #17324d;
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.08;
  text-transform: uppercase;
}

.preview-lines {
  display: block;
  width: 66%;
  height: 24px;
  border-top: 2px solid rgba(23, 50, 77, 0.22);
  border-bottom: 2px solid rgba(23, 50, 77, 0.22);
  opacity: 0.75;
}

.article-meta {
  margin-top: auto;
  padding-top: 12px;
  color: #17324d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portfolio-card {
  min-height: 360px;
  padding: 14px;
  border: 3px solid #17324d;
  background: #fff5d6;
  box-shadow: 7px 7px 0 #17324d;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

a.portfolio-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.portfolio-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 11px 11px 0 #17324d;
  border-color: #d85d62;
}

.card-toggle:focus-visible + .portfolio-card {
  outline: 3px solid #d85d62;
  outline-offset: 4px;
}

.card-toggle:checked + .portfolio-card {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: auto;
  height: 100vh;
  height: 100dvh;
  padding: clamp(56px, 8vh, 96px) clamp(16px, 5vw, 72px) 24px;
  overflow-y: auto;
  transform: none;
  box-shadow: 12px 12px 0 #17324d;
  animation: card-open 300ms ease-out both;
}

#certificate-one:checked + .portfolio-card,
#certificate-two:checked + .portfolio-card {
  padding: 0;
  transform: none;
}

#certificate-one:checked + .portfolio-card .certificate-preview,
#certificate-two:checked + .portfolio-card .certificate-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  height: auto;
  margin: 0;
  border: 0;
}

#certificate-one:checked + .portfolio-card .card-title,
#certificate-one:checked + .portfolio-card .card-text,
#certificate-two:checked + .portfolio-card .card-title,
#certificate-two:checked + .portfolio-card .card-text {
  display: none;
}

.close-button {
  display: none;
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 30;
  padding: 10px 14px;
  color: #fff5d6;
  border: 2px solid #fff5d6;
  background: #d85d62;
  box-shadow: 3px 3px 0 #17324d;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

body:has(.card-toggle:not(#portfolio-close):checked) .close-button {
  display: block;
  animation: close-open 300ms ease-out both;
}

body:has(.card-toggle:not(#portfolio-close):checked) {
  overflow: hidden;
}

body:has(#portfolio-close:checked) .portfolio-card {
  animation: card-close 300ms ease-out both;
}

.card-image {
  height: 200px;
  margin-bottom: 22px;
  border: 2px dashed #d85d62;
  background: transparent;
}

.certificate-preview {
  overflow: hidden;
  border-style: solid;
}

.certificate-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.certificate-preview a {
  display: block;
  padding: 20px;
  color: #17324d;
  font-weight: 700;
}

.card-title {
  margin-bottom: 10px;
  color: #17324d;
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-text {
  color: #17324d;
  font-size: 0.9rem;
  line-height: 1.5;
}

a.portfolio-card:focus-visible {
  outline: 3px solid #d85d62;
  outline-offset: 5px;
}

@media (max-width: 1000px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-section {
    padding-right: clamp(24px, 5vw, 56px);
    padding-left: clamp(24px, 5vw, 56px);
  }

  .section-menu {
    gap: 7px;
  }

  .section-button {
    padding: 8px 10px;
    font-size: 0.68rem;
  }
}

@media (max-width: 640px) {
  .sky {
    min-height: 100svh;
  }

  .intro {
    top: 12vh;
    left: 20px;
    max-width: min(76vw, 400px);
  }

  .eyebrow {
    max-width: 30ch;
    font-size: 0.63rem;
    line-height: 1.5;
  }

  .name {
    max-width: 7ch;
    font-size: clamp(2.8rem, 15vw, 5rem);
  }

  .hint {
    max-width: 25ch;
    margin-top: 18px;
  }

  .sun {
    top: 15vh;
    right: 8vw;
  }

  .more-about-me {
    top: 55%;
    width: calc(100% - 36px);
  }

  .more-about-me > div {
    font-size: clamp(1.8rem, 9vw, 3rem);
  }

  .more-about-me h3 {
    margin-top: 8px;
    font-size: clamp(0.74rem, 3.3vw, 0.9rem);
    line-height: 1.35;
  }

  .section-menu {
    top: auto;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 7px;
    padding: 8px;
    border: 2px solid #17324d;
    background: rgba(249, 215, 229, 0.96);
    box-shadow: 4px 4px 0 #17324d;
  }

  .section-button {
    flex: 1 1 0;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 9px 5px;
    font-size: clamp(0.52rem, 2.2vw, 0.68rem);
  }

  .portfolio-section {
    min-height: auto;
    padding: 74px 18px 76px;
    scroll-margin-top: 12px;
  }

  .section-heading {
    margin-bottom: 28px;
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 460px;
    gap: 20px;
  }

  .portfolio-card,
  .article-card {
    min-height: 0;
  }

  .card-image,
  .article-text-preview {
    height: 190px;
    min-height: 190px;
  }

  .article-text-preview {
    padding: 60px 20px 16px;
  }

  .article-text-preview strong {
    font-size: clamp(1.1rem, 5vw, 1.45rem);
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-text {
    font-size: 0.88rem;
  }

  .card-toggle:checked + .portfolio-card {
    padding: 68px 16px 20px;
  }

  .close-button {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 360px) {
  .section-button {
    gap: 3px;
    padding-right: 3px;
    padding-left: 3px;
    font-size: 0.5rem;
  }

  .section-icon {
    font-size: 0.78rem;
  }

  .portfolio-section {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 800px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-card {
    min-height: 0;
  }

  .card-toggle:checked + .portfolio-card {
    inset: 0;
    width: auto;
    height: 100vh;
    height: 100dvh;
  }

  #certificate-one:checked + .portfolio-card,
  #certificate-two:checked + .portfolio-card {
    transform: none;
  }

  #certificate-one:checked + .portfolio-card .certificate-preview,
  #certificate-two:checked + .portfolio-card .certificate-preview {
    height: auto;
  }

  .close-button {
    top: 22px;
    right: 22px;
  }

  .card-image {
    height: 180px;
  }

  .section-menu {
    top: 14px;
    right: 14px;
    gap: 7px;
  }

  .section-button {
    padding: 8px 9px;
    font-size: 0.65rem;
  }
}

@media (max-width: 600px) {
  .section-menu {
    right: 10px;
    gap: 5px;
  }

  .section-button {
    gap: 4px;
    padding: 7px;
    font-size: 0.58rem;
  }

  .section-icon {
    font-size: 0.85rem;
  }

  .more-about-me {
    top: 54%;
    width: calc(100% - 24px);
    max-width: none;
  }

  .more-about-me > div {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }

  .more-about-me h3 {
    margin: 10px 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: center;
  }

  .name {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }
}

@media (min-width: 641px) and (max-width: 1000px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .section-menu {
    top: auto;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    height: auto;
    align-items: center;
  }

  .portfolio-section {
    min-height: auto;
    padding: 74px 18px 76px;
  }

  .portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-image,
  .article-text-preview {
    height: 190px;
    min-height: 190px;
  }
}

@media (max-width: 900px) {
  .sky {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: clamp(30px, 7vh, 56px);
    padding: 110px clamp(24px, 8vw, 72px);
  }

  .sun {
    top: 4vh;
    right: 8vw;
    width: clamp(64px, 12vw, 100px);
  }

  .intro {
    top: auto;
    left: auto;
    max-width: min(580px, 100%);
  }

  .more-about-me {
    top: auto;
    left: auto;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    transform: none;
  }

  .more-about-me > div {
    font-size: clamp(2.2rem, 7vw, 4rem);
  }
}

@media (max-width: 640px) {
  .sky {
    align-content: start;
    gap: clamp(36px, 8vh, 64px);
    padding: 100px 20px 112px;
  }

  .sun {
    top: 4vh;
    right: 8vw;
    width: 56px;
  }

  .intro {
    max-width: min(450px, 100%);
  }

  .more-about-me {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .more-about-me > div {
    font-size: clamp(2rem, 9vw, 3.2rem);
  }
}
