/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* ==========================================================================
   1. NORMALIZE.CSS (Browser Reset)
   ========================================================================== */

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

body {
  margin: 0;
}

main {
  display: block;
}

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

a {
  background-color: transparent;
}

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  border-style: none;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

progress {
  vertical-align: baseline;
}

textarea {
  overflow: auto;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

details {
  display: block;
}

summary {
  display: list-item;
}

template {
  display: none;
}

[hidden] {
  display: none;
}

/* ==========================================================================
   2. CUSTOM VARIABLES & GLOBAL STYLES
   ========================================================================== */

:root {
  --primary-color: #20504b; /* New Teal Color */
  --primary-hover-color: #1a403c; /* Darker Teal for hover */
  --secondary-color: #f4f4f4; /* Lighter Gray for background */
  --text-color: #333; /* Dark Gray */
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --button-bg-color: var(--primary-color);
  --button-text-color: #ffffff;

  /* Customized-style colors for the grid */
  --grid-item-bg-color: #2c3e50; /* New Dark Slate Blue */
  --grid-item-text-color: #ffffff; /* White */

  /* Customized Orange for links */
  --customized-orange: #ff8c00; /* Vibrant Orange */
  --customized-orange-hover: #cc7000; /* Darker Orange for hover */

  /* Alternate (White/Blue) colors */
  --alt-grid-item-bg-color: #ffffff;
  --alt-grid-item-text-color: #0056b3;
}

body {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #d9e1e5;
  margin: 0; /* Ensures Normalize reset is reinforced */
}

* {
  box-sizing: border-box;
}

h1,
h2,
h3,
h4 {
  line-height: 1.4;
}

h1 {
  font-size: 2.5em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.8em;
  font-weight: 700;
}

h3 {
  font-size: 1.5em;
  font-weight: 700;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* ==========================================================================
   3. BUTTONS
   ========================================================================== */

.button {
  display: inline-block;
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  font-weight: 700;
  font-size: 1.1em;
  padding: 12px 24px;
  border-radius: 3px;
  border: 2px solid transparent;
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.button:hover,
.button:focus {
  background-color: var(--primary-hover-color);
}

.button--cv {
  margin-top: 20px;
  background-color: var(--primary-color);
  color: var(--button-text-color);
  border-color: var(--primary-color);
}

.button--cv:hover {
  background-color: var(--alt-grid-item-bg-color);
  color: var(--alt-grid-item-text-color);
  border-color: var(--alt-grid-item-text-color);
}

/* Skill Buttons */
.skills-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
  max-width: 80%;
}

.skill-button {
  flex-grow: 1;
  flex-basis: 120px;
  text-align: center;
  font-weight: bold;
  border: 2px solid var(--grid-item-bg-color);
  max-width: 140px;
  padding: 10px;
}

/* Blue background, white text */
.skill-button--primary {
  background-color: var(--grid-item-bg-color);
  color: var(--grid-item-text-color);
}

.skill-button--primary:hover {
  background-color: var(--alt-grid-item-text-color);
  border-color: var(--alt-grid-item-text-color);
  color: var(--grid-item-text-color);
}

/* White background, blue text */
.skill-button--alt {
  background-color: var(--alt-grid-item-bg-color);
  color: var(--alt-grid-item-text-color);
}

.skill-button--alt:hover {
  background-color: var(--secondary-color);
  color: var(--alt-grid-item-text-color);
}

/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background-color: var(--primary-color);
  color: #fff;
}

.page-header__item {
  margin-bottom: 10px;
}

.page-header .navigation-list a {
  color: #fff;
  text-decoration: none;
}

.page-header .navigation-list a:hover,
.page-header .navigation-list a:focus {
  text-decoration: underline;
}

.navigation-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  text-align: center;
  font-size: 1.2em;
}

.navigation-list li {
  display: inline-block;
  margin: 0 15px;
}

.navigation__logo {
  width: 100%;
  height: 10px;
  object-fit: cover;
  display: block;
}

.nav-name {
  color: var(--customized-orange);
  font-weight: bold;
}

/* ==========================================================================
   5. PAGE LAYOUTS
   ========================================================================== */

.home-main,
.about-main,
.contact-main {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  min-height: calc(100vh - 250px);
}

.hero,
.about-container,
.contact-container {
  background-color: #ffffff;
  padding: 30px 40px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  width: 100%;
  text-align: center;
}

/* Headings inside containers */
.hero h1,
.about-container h1,
.contact-container h1,
.work-main h1 {
  color: var(--alt-grid-item-text-color); /* Blue color: #0056b3 */
  font-size: 2.2em;
}

/* Images */
.hero__portrait {
  width: 290px;
  height: 100px;
  border-radius: 2%;
  object-fit: cover;
  margin-bottom: 20px;
}

.about__portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
}

.about__profile-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.about__image-container {
  margin-top: 30px;
}

.about__image-container img {
  max-width: 50%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.contact-details {
  margin: 20px 0;
  line-height: 1.8;
}

.contact-details p {
  margin: 5px 0;
}

/* ==========================================================================
   6. GRID SYSTEM (WORK PAGE)
   ========================================================================== */

.work-main {
  padding: 15px 0;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 5px;
}

.grid > [class^="grid__item"] {
  margin: 4px;
  padding: 8px 10px;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease-in-out;
  flex-shrink: 0;
  width: calc(21.667% - 12px); /* Default width */
}

.grid > [class^="grid__item"] h2 {
  font-size: 1em;
  margin-bottom: 4px;
}

.grid > [class^="grid__item"] p {
  font-size: 0.7em;
  line-height: 1.3;
}

.grid > [class^="grid__item"]:hover {
  transform: translateY(-3px);
}

/* Theme 1: Dark Blue Background, White Text */
.grid__item__1,
.grid__item__3,
.grid__item__5,
.grid__item__7 {
  background-color: var(--grid-item-bg-color);
  color: var(--grid-item-text-color);
}

.grid__item__1 h2,
.grid__item__3 h2,
.grid__item__5 h2,
.grid__item__7 h2 {
  color: var(--grid-item-text-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 4px;
}

.grid__item__1 a,
.grid__item__3 a,
.grid__item__5 a,
.grid__item__7 a {
  color: var(--customized-orange);
  font-weight: bold;
  font-size: 0.8em;
}

.grid__item__1 a:hover,
.grid__item__3 a:hover,
.grid__item__5 a:hover,
.grid__item__7 a:hover {
  color: var(--customized-orange-hover);
}

/* Theme 2: White Background, Blue Text */
.grid__item__2,
.grid__item__4,
.grid__item__6,
.grid__item__8 {
  background-color: var(--alt-grid-item-bg-color);
  color: var(--text-color);
}

.grid__item__2 h2,
.grid__item__4 h2,
.grid__item__6 h2,
.grid__item__8 h2 {
  color: var(--alt-grid-item-text-color);
  border-bottom: 1px solid rgba(0, 86, 179, 0.2);
  padding-bottom: 4px;
}

.grid__item__2 a,
.grid__item__4 a,
.grid__item__6 a,
.grid__item__8 a {
  color: var(--customized-orange);
  font-weight: bold;
  font-size: 0.8em;
}

.grid__item__2 a:hover,
.grid__item__4 a:hover,
.grid__item__6 a:hover,
.grid__item__8 a:hover {
  color: var(--customized-orange-hover);
}

.project-screenshot {
  width: 100%;
  height: auto;
  border-radius: 5px;
  margin-bottom: 12px;
  border: 1px solid var(--secondary-color);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */

.page-footer {
  clear: both;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 20px;
  background-color: var(--primary-color);
  color: #fff;
  font-size: 1.1em;
}

.page-footer a {
  color: var(--customized-orange);
  font-weight: bold;
}

.page-footer a:hover {
  color: var(--customized-orange-hover);
}

.social-media a {
  margin: 0 10px;
}

/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */

/* Tablet: 2 columns (for screens <= 992px) */
@media all and (max-width: 992px) {
  .grid > [class^="grid__item"] {
    width: calc(32.5% - 12px);
  }
}

/* Mobile: 1 column (for screens <= 600px) */
@media all and (max-width: 600px) {
  .grid > [class^="grid__item"] {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Skill Button Responsiveness */
@media all and (max-width: 768px) {
  .skill-button {
    width: calc(50% - 10px);
    max-width: none;
  }
}

@media all and (max-width: 500px) {
  .skill-button {
    width: 100%;
    max-width: none;
  }
}
